Bookmarklet reality check

Bug reports and enhancement requests
Post Reply
agaxwmtp
Posts: 13
Joined: Fri Jan 11, 2013 10:14 pm

Bookmarklet reality check

Post by agaxwmtp » Sat Mar 01, 2014 11:15 am

I hardly ever use bookmarklets. There are a few threads taking about Noscript having some issues with them. The threads are technical and I don't understand.

Could somebody explain in a non-technical way what sorts of issues/problems Noscript is having with bookmarklets?

Also - is there some easy way to be certain bookmarklets will work? I mean, if I want to use bookmarklets on example.com - is there some setting that will help ensure that they work?
Mozilla/5.0 (Windows NT 6.2; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0

User avatar
Giorgio Maone
Site Admin
Posts: 8802
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Bookmarklet reality check

Post by Giorgio Maone » Sat Mar 01, 2014 9:44 pm

agaxwmtp wrote:Could somebody explain in a non-technical way what sorts of issues/problems Noscript is having with bookmarklets?

You normally couldn't execute any bookmarklet on a page where scripts are disabled, e.g. by NoScript.
Therefore NoScript provides, as a "courtesy" usability feature, a bookmarklet emulation feature which so far managed to run almost any bookmarklet even on script-disabled pages, by running their code in a sandbox and/or temporarily enabling scripts just for the time of the bookmarklet execution.
The way Firefox handles JavaScript executed in a sandbox or on a page where scripts have been disabled after installing event handlers has changed in Firefox 27, breaking NoScript's bookmarklet emulation mode.
The many threads you could recently see about bookmarklets are caused by this breakage and my attempts to work around it.
agaxwmtp wrote:Also - is there some easy way to be certain bookmarklets will work? I mean, if I want to use bookmarklets on example.com - is there some setting that will help ensure that they work?

Installing latest development build 2.6.8.17rc1 should suffice most of the time, but some bookmarklets may require you to allow at least the page where you want to run them.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0

User avatar
Thrawn
Senior Member
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

Re: Bookmarklet reality check

Post by Thrawn » Sun Mar 02, 2014 11:39 pm

agaxwmtp wrote:Also - is there some easy way to be certain bookmarklets will work? I mean, if I want to use bookmarklets on example.com - is there some setting that will help ensure that they work?

In some cases, you could convert them into NoScript surrogate scripts.
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.

True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0

agaxwmtp
Posts: 13
Joined: Fri Jan 11, 2013 10:14 pm

Re: Bookmarklet reality check

Post by agaxwmtp » Mon Mar 03, 2014 12:33 am

Thrawn wrote:
agaxwmtp wrote:Also - is there some easy way to be certain bookmarklets will work? I mean, if I want to use bookmarklets on example.com - is there some setting that will help ensure that they work?

In some cases, you could convert them into NoScript surrogate scripts.


There's such a thing as "NoScript surrogate scripts"? Can a non-programmer write them? Ha, even if non-programmer can't - could somebody explain them a bit or give me a link or two to look at?
Mozilla/5.0 (Windows NT 6.2; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0

barbaz
Senior Member
Posts: 9448
Joined: Sat Aug 03, 2013 5:45 pm

Re: Bookmarklet reality check

Post by barbaz » Mon Mar 03, 2014 3:12 am

agaxwmtp wrote:There's such a thing as "NoScript surrogate scripts"? Can a non-programmer write them? Ha, even if non-programmer can't - could somebody explain them a bit or give me a link or two to look at?

http://hackademix.net/2011/09/29/script-surrogates-quick-reference/
sources pref url pattern takes any of these syntax:
http://noscript.net/abe/abe_rules.pdf wrote:• ^https?://some\.site\.com/.*
regular expression
• *.some.site.com
(matches anything.some.site.com but not some.site.com) or
.some.site.com (matches anything.some.site.com and some.site.com)
glob expression; a glob expression starting with “.” will match both the subdomains having
it as a suffix and the domain stripped of the leading dot.
• www.some.site.com
domain literal
• http://www.somesite.com
URI literal with “starts with” matching
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24

User avatar
Thrawn
Senior Member
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

Re: Bookmarklet reality check

Post by Thrawn » Mon Mar 03, 2014 4:13 am

Depending on the bookmarklet, you might just be able to just copy and paste it. See viewtopic.php?f=10&t=19191#p67715
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.

True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0

Post Reply