Page 1 of 1

Bookmarklet not working

Posted: Sun Jan 05, 2014 4:35 pm
by theArchitektas
Okay, I have a bookmark with this JS:

Code: Select all

javascript:(function(){document.body.appendChild(document.createElement("script")).src="//raw.github.com/Azeirah/azeirah.github.io/master/groovemarklet2.js"})()
It's for extracting song info from sites like Pandora, Grooveshark, you name it.

Thing is, it doesn't work with NoScript enabled:

Code: Select all

[NoScript] Blocking nosniff Javascript served from https://raw.github.com/Azeirah/azeirah.github.io/master/groovemarklet2.js with wrong type info text/plain, inline and included by http://grooveshark.com/
Setting the noscript.nosniff to false and retrying throws this:

Code: Select all

[NoScript] Blocking cross-site Javascript served from https://raw.github.com/Azeirah/azeirah.github.io/master/groovemarklet2.js with wrong type info text/plain, inline and included by http://grooveshark.com/
Any help would be appreciated.

Re: Bookmarklet not working

Posted: Sun Jan 05, 2014 5:22 pm
by barbaz
theArchitektas wrote:Setting the noscript.nosniff to false and retrying throws this:

Code: Select all

[NoScript] Blocking cross-site Javascript served from https://raw.github.com/Azeirah/azeirah.github.io/master/groovemarklet2.js with wrong type info text/plain, inline and included by http://grooveshark.com/
Well, I think you can try to "fix" this one by adding

Code: Select all

https://raw.github.com/Azeirah/azeirah.github.io/master/
to noscript.inclusionTypeChecking.exceptions in about:config.
I have no idea about the nosniff error though :?:

Re: Bookmarklet not working

Posted: Sun Jan 05, 2014 6:35 pm
by theArchitektas
Heh, looks like that fixed the problem, even nosniff can be set to true now. Thanks.

Re: Bookmarklet not working

Posted: Mon Jan 06, 2014 4:01 am
by Thrawn
The reason for this is that Github is correctly telling your browser that you're not meant to do this, that the file is supposed to be downloaded, not included in the page.

And since you don't know what someone is going to commit to Github, this isn't really safe.

You'd be better off downloading the whole script and copying it into your bookmarklet.