Javascript bookmarklet stopped working in Firefox 41

[亡魂溺海] 提交于 2019-12-08 05:33:42

问题


In Firefox 41, bookmarklets (bookmarks with a javascript: URL, e.g. javascript: alert("it works"), run from a click or a keyword) stopped working. Is there any solution to use javascript: bookmarks in Firefox 41?

Previously seen, understood and solved in Javascript bookmark stopped working in Firefox 13:

If you first load almost any URL, including about:blank, then a Javascript bookmark will work in that tab.

Since Firefox's default behavior for new tabs is about:newtab, which is nothing, and bookmarklets only run once something is loaded, you can do the following to set a default page, and then run bookmarklets:

  1. open about:config
  2. find browser.newtab.url
  3. double-click and change from about:newtab to about:blank (or URI of your choice)
  4. Ctrl-T and run bookmarklets in new tabs!

But this no longer works

I can only assume it's related to the browser.newtabpage setting activated by default. However, disabling the newtabpage features did not re-enable it.

Other reports of the issue, and solutions, online refer only to installing the New Tab Override extension. That does work - but is there another way, other than by installing an extension?


回答1:


According to ghacks, Mozilla wanted the feature removed from about:config and only re-settable via extension:

The browser.newtab.url preference has no exposed UI, is not really supported, and is abused by search hijackers. We should remove it and encourage people using a non-default new tab page to install an add-on instead.

So, unless policy reverses itself (unlikely, as this is not the first time Mozilla has removed about:config features and insisted they be replaced by extensions), using an extension like New Tab Override is the only option.


UPDATE: If you install New Tab Override, you must configure it first, and manually add about:blank to the extension settings.



来源:https://stackoverflow.com/questions/32782860/javascript-bookmarklet-stopped-working-in-firefox-41

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!