[web browser]No way to use a bookmarklet (bookmarked javascript: link)

Bug #1407746 reported by Stuart Langridge on 2015-01-05
34
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Ubuntu UX
Low
James Mulholland
webbrowser-app (Ubuntu)
Medium
Unassigned

Bug Description

The Ubuntu browser has no way to use bookmarklets (a bookmarked javascript: link which runs some code in the context of the currently viewed page, rather than navigating to a new page). See https://www.readability.com/bookmarklets for an example of such bookmarklets and why they're useful. In short, bookmarklets are a slightly clunky but open and available way for people to augment the capabilities of a web browser without being blocked on the browser developers implementing a feature.

In order to use bookmarklets, it must be possible to:

1. get a javascript: link into the browser's bookmarks database. Ideally this would be doable with JS in a client page; a suboptimal but possible alternative is the approach that iOS Safari takes, where one bookmarks a random URL and then edits the bookmark to contain a (copy-and-pasted) JavaScript URL instead. Neither are possible on Ubuntu's browser; bookmarks cannot be manually edited.
2. Invoke the bookmark in the current tab. This is not possible in the Ubuntu browser: one cannot open a bookmark in an existing tab, because the list of bookmarks is only available in the new tab screen.

Olivier Tilloy (osomon) wrote :

Note that despite the UI limitations that forbid creating bookmarklets, such code snippets do actually work when manually inserted in the bookmarks database. Tested with the following code snippet:

    javascript:(function(){alert('test');})();

Changed in webbrowser-app:
status: New → Confirmed
importance: Undecided → Medium
Changed in webbrowser-app (Ubuntu):
status: New → Confirmed
Olivier Tilloy (osomon) on 2015-06-08
Changed in webbrowser-app (Ubuntu):
importance: Undecided → Medium
Changed in webbrowser-app:
status: Confirmed → Invalid
Olivier Tilloy (osomon) wrote :

Note that the address bar now displays bookmarks along with history entries and search suggestions, so it should be possible to activate a bookmarklet this way on an open page (although I have to admit it’s not necessarily the most obvious UX).

no longer affects: webbrowser-app
Olivier Tilloy (osomon) wrote :

It is also now possible to long-press on a link and add it to bookmarks.

Olivier Tilloy (osomon) wrote :

Just tested the above statement, and this doesn’t work for bookmarklets: the URL that is being bookmarked is "about:blank", which is not very useful…

Olivier Tilloy (osomon) wrote :

This can be fixed in the browser by using the 'unfilteredLinkUrl' property of the context menu (we’re currently using 'linkUrl' everywhere). I imagine the browser could try to be clever by using the unfiltered link url when it encounters about:blank for the link url.

Olivier Tilloy (osomon) wrote :

Added an ubuntu-ux task to get design’s take on what the typical workflow should be to create/use bookmarklets in the browser.

summary: - No way to use a bookmarklet (bookmarked javascript: link)
+ [web browser]No way to use a bookmarklet (bookmarked javascript: link)
Changed in ubuntu-ux:
importance: Undecided → Medium
importance: Medium → Low
status: New → Triaged
assignee: nobody → James Mulholland (jamesjosephmulholland)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers