Javascript bookmark stopped working in Firefox 13

前端 未结 3 1756
情歌与酒
情歌与酒 2021-02-19 05:40

In Firefox version 13, bookmarklets (bookmarks with a javascript: URL, e.g. javascript: alert(\"it works\") stopped working. Is there any solution to u

3条回答
  •  渐次进展
    2021-02-19 06:14

    I have been able to use bookmarklets in recent versions of firefox (I just tested a few on FF23). Two suggestions:

    1. Replace spaces with %20. For instance, try your example bookmarklet code with javascript:alert("it%20works") instead of javascript:alert("it works")
    2. If this isn't enough, enclose the whole bookmarklet inside an anonymous function, so in your example, you'd write javascript:((function(){alert("it%20works");})())

提交回复
热议问题