We have moved to a new Sailfish OS Forum. Please start new discussions there.
10

Add bookmarklets support to web-browser

asked 2015-02-15 18:18:53 +0300

sandy_locke gravatar image

Since the Jolla Tablet won't get much apps or plugins api in the beginning, I strongly suggest you work on adding a bookmarklet support for the browser. Simple way would be to have a fav bar below the address bar where one can put any bookmark(let) that one want, but you could come up with better ways.

It's important, because it would allow immediate support for third-party open source web-apps that we use with our own servers or that lie around on internet.

Examples of third-parties that use bookmarklet:

Proprietary: Pocket

Open-Source: Wallabag

And many many others !

edit retag flag offensive close delete

Comments

1

Isn't it enough to add bookmarks to the app-screen? What benefits do you see with having them in the browser? :)

attah ( 2015-02-15 23:01:57 +0300 )edit

I'm talking about bookmarklets : https://en.m.wikipedia.org/wiki/Bookmarklet

sandy_locke ( 2015-02-16 01:34:37 +0300 )edit

I assume it works with the Jolla Browser it shares the same Engine as the FF more about the Browser on github

Nokius ( 2015-02-17 23:50:39 +0300 )edit

@Nokius: yes but is there a way to create bookmarklet that you can access from any web page ? It's nice if the engine is already here, but you've got to have a front end to launch bookmarklet from within the browser UI.

sandy_locke ( 2015-02-18 00:09:38 +0300 )edit

@sandy_locke may be open a issue on github https://github.com/sailfishos/sailfish-browser

Nokius ( 2015-02-22 21:53:47 +0300 )edit

2 Answers

Sort by » oldest newest most voted
4

answered 2016-07-21 18:50:34 +0300

DaveRo gravatar image

updated 2016-07-24 20:29:21 +0300

So, I now have a Jolla C and can answer some of the points in my earlier answer.

Yes, bookmarklets work in the Jolla Browser. This is what you have to do:

  1. Create a bookmark - anything. (But choose a page that generates a good icon because I don't think you can change it.)
  2. Edit it: long press > 'Edit Favourite'
  3. Set the title to something suitable and short.
  4. Set the web address to the javascript string - see below

The javascript string should be in the form:
javascript:xxxxxxxxxxxxxxxxxxx;
eg
javascript:alert("This is a bokmarklet");

For anything non-trivial it's good practice to use an anonymous function to avoid polluting the page scope, e.g.
javascript:(function(){xxxxxxxxxxxxxxxxxxx})();

To use it, tap the url of the current page (not the tab icon) at the bottom, then tap the bookmark. That javascript will then run in the current page.

There is however a big limitation. I often use bookmarklets to process text that's selected (highlighted) on the webpage, and AFAICS you can't do that in the Jolla browser.

Edit 1 24-7-16

A couple of useful bookmarklets for the Jolla Browser:

  • Scroll to top of page: javascript:window.scrollTo(0,0);
  • Scroll to bottom of page: javascript:window.scrollTo(0,1000000);
edit flag offensive delete publish link more
0

answered 2015-10-27 13:19:45 +0300

DaveRo gravatar image

updated 2016-07-21 18:51:19 +0300

I'm not sure I understand the intention of this proposal. As the browser is gecko-based surely it will run bookmarklets?

I've been using and writing bookmarklets for years. Although I use Firefox I often test them on other platforms. On tablets I find 3 main issues:

1 Getting them into the browser's bookmarks; easy on Firefox, hard on iPad (for security reasons I assume).

3 Calling them without losing the current page. This is essential; easiest on iPad, very onerous on Android/Chrome.

3 Accessing selected text: this is important, for me anyway - you select some text and the bookmarklet does something with it. This only works well on iPad in my experience.

A bookmarks toolbar is nice (iPad has one) but not essential. Firefox/Android doesn't - it takes up space.

I know this is not really an answer, but it's more than a comment. I'm waiting for my tablet and haven't seen the SFOS browser yet. So how does it rate against my 3 criteria?

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
3 followers

Stats

Asked: 2015-02-15 18:18:53 +0300

Seen: 517 times

Last updated: Jul 24 '16