Open Bug 1811582 Opened 1 year ago Updated 2 months ago

Bookmarklets doesn't work from bookmarks

Categories

(Fenix :: Bookmarks, defect)

All
Android
defect

Tracking

(Not tracked)

People

(Reporter: csadilek, Unassigned)

Details

From github: https://github.com/mozilla-mobile/fenix/issues/2871.

Steps to reproduce

Save any site to bookmarks
Edit this bookmark and put in there a Javascript as url, e.x.
javascript:%20(function%20()%20{%20%20%20%20%20%20window.open('https://invidio.us/watch?v='%20+%20document.location.href.replace(/^.+v=(.{11})(.+)?/g,%20'$1'));%20%20})();
Save this edited bookmark
Use it on YouTube for download a video.

Expected behavior

The YT Video will be downloaded

Actual behavior

The url of the bookmarklet will be searched

Device information

  • Android device: Samsung Galaxy Tab SM-T580 and Huawei P smart
  • Fenix version: 1.0.1921 Nightly and Raptor

┆Issue is synchronized with this Jira Task

Change performed by the Move to Bugzilla add-on.

The severity field is not set for this bug.
:cpeterson, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(cpeterson)
Flags: needinfo?(cpeterson)

I did not manage to reproduce this with the script from the STR. Settings S3 for now, having better STR and a script that does not work would help. From reading through GH tickets and PR, seems like this issue was fixed at some point but reverted. Whoever picks this, I recommend reading through the issue in the first comment, as well as: this PR and the initial feature request.

Severity: -- → S3

A simpler test script would be creating a bookmark like javascript:alert("Worked")

Expected behavior: See an alert

Actual Behaviour: Nothing happens

Bookmarklets actually works sometime, few even works every time when I testing it.

For example, javascript:(function() { window.location = `https://translate.google.com/translate?sl=auto&tl=zh-TW&u=${encodeURIComponent(window.location)}`; })() works every time. But javascript:(function() { window.open(`https://example.com/?url=${encodeURIComponent(location)}`, "_blank", "noopener"); })() and javascript:alert(1) rarely works, although they did execute in some random instances.

You need to log in before you can comment on or make changes to this bug.