Recently I noticed that a few of my bookmarklets don't work right anymore because data from view-source: urls isn't displayed. The only mention of this I can find is "v 2.1.2.7rc1 + Prevent any website from embedding view-source URIs inside frames" in the changelog. I couldn't find any documentation on why this was done or a pref to disable this behavior.
So my question is: How do I fix NoScript to make my bookmarklets work again?
NoScript breaks view-source:
NoScript breaks view-source:
Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20100101 Firefox/8.0
Re: NoScript breaks view-source:
Could you post the bookmarklets in question?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0a2) Gecko/20111118 Firefox/10.0a2 SeaMonkey/2.7a2
Re: NoScript breaks view-source:
Here's one:
Code: Select all
javascript:s=document.getElementsByTagName('SCRIPT'); d=window.open().document; d.open();d.close(); b=d.body; function trim(s){return s.replace(/^\s*\n/, '').replace(/\s*$/, ''); } function add(h){b.appendChild(h);} function makeTag(t){return d.createElement(t);} function makeText(tag,text){t=makeTag(tag);t.appendChild(d.createTextNode(text)); return t;} add(makeText('style', 'iframe{width:100%;height:18em;border:1px solid;}')); add(makeText('h3', d.title='Scripts in ' + location.href)); for(i=0; i<s.length; ++i) { if (s[i].src) { add(makeText('h4','script src="' + s[i].src + '"')); iframe=makeTag('iframe'); iframe.src='view-source:'+s[i].src; add(iframe); } else { add(makeText('h4','Inline script')); add(makeText('pre', trim(s[i].innerHTML))); } } void 0
Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20100101 Firefox/8.0
- Giorgio Maone
- Site Admin
- Posts: 9524
- Joined: Wed Mar 18, 2009 11:22 pm
- Location: Palermo - Italy
- Contact:
Re: NoScript breaks view-source:
Reason is #1 here.
There's no setting to restore the original behavior and allow framed view-source docs (which, BBTW, are supported by Firefox only), but as a work-around you could open your view-source in a top-level window.
There's no setting to restore the original behavior and allow framed view-source docs (which, BBTW, are supported by Firefox only), but as a work-around you could open your view-source in a top-level window.
Mozilla/5.0 (Windows NT 5.2; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0