[INVALID] Incompatibility with "View Source Chart" addon

Ask for help about NoScript, no registration needed to post
skittleys
Posts: 1
Joined: Fri Feb 24, 2012 7:07 pm

[INVALID] Incompatibility with "View Source Chart" addon

Post by skittleys »

NoScript causes the "View Source Chart" (VSC) addon to not function properly. The chart is created, the highlight-on-hover works, but no "hot areas" are created and therefore the collapsing feature doesn't work.

I've tried to fix it myself, with no luck. First of all, I've tried it with both NoScript 2.2.8 and 2.3.1, as well as Firefox 10.0b5 and 11.0b4. It doesn't work. When I disable NoScript + restart, it works perfectly -- so it's definitely related to NoScript.

Here's the strangest part...first of all, VSC has always had a weird bug where, if you try to load a url in the new tab generated by VSC, it starts loading, but then VSC overlays the chart on top. You'd have to try it yourself to see what I mean, it's hard to explain. Anyway, I accidentally discovered that if I purposely do this in the VSC tab and have the "Temporarily allow top-level domains..." option set in NoScript (or already have the new URL in your whitelist), when VSC makes the new overlay, the collapsing works! And if I look at NoScript, it thinks the top-level domain is that new site, so I assume that's why it's loaded!

When the VSC chart is first created (after doing right click --> "View Source Chart" on any page), it loads in an about:blank tab. This is already in my whitelist, and I don't see what else I could add to allow this script to run.

Based on the code and the "Developer's Comments" from the add-on page, I think it has something to do with how collapse.js is imported.

Relevant info from the Developer's Comments:
* To Collapse, click any hot area, indicated by a pointer style cursor.
* To Expand, click anywhere in the collapsed container.
************************************
Source Charts are based on the post-rendered source returned by the browser, the same source you see when selecting "View Selection Source" (CTRL + A then right click).
I have no idea how to make the script work.

Any ideas?!?!?


Edit: How to understand all the behaviour I've described above:

See how it normally works:
  1. Download VSC (link is above) and disable NoScript. Restart Firefox.
  2. Go to any website, right-click, and choose "View Source Chart".
  3. Click on an HTML tag like <head> or <div> and watch the cool way it collapses!
See how it works with NoScript:
  1. Enable NoScript. Restart Firefox.
  2. Go to any website, right-click, and choose "View Source Chart".
  3. Click on an HTML tag like <head> or <div> and watch NOTHING happen.
See how it works when you try to load a new URL in that tab:
  1. In a VSC tab, enter a URL that is definitely in your whitelist, like http://noscript.net/, and load the page.
  2. Watch how the page starts to load but then VSC takes over
  3. Click on an HTML tag and see that collapsing works again!
Mozilla/5.0 (Windows NT 6.0; rv:11.0) Gecko/20100101 Firefox/11.0
chartee

Re: Incompatibility with "View Source Chart" addon

Post by chartee »

The issue of not being able to navigate to a new URL without the chart of that new URL loading is due to the following line in the VSC addon:

Code: Select all

newvrsTab.addEventListener("load", function() { newvrsTab.contentDocument.body.innerHTML = VSC_Source;newvrsTab.contentDocument.title="View Source Chart of: "+ contentTitle;}, true);
Probably doesn't help w/ the no script issue, but thought I'd throw it out there as an FYI.
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Incompatibility with "View Source Chart" addon

Post by Giorgio Maone »

The problem is that when NoScript is installed content at about:blank cannot execute scripts of its own even if whitelisted by NoScript: that's a Mozilla CAPS thing introduced by Firefox 4, not sure if intended as a security measure or a bug, but shouldn't cause any problem on normal web content or properly written extensions.

Unfortunately View Source Chart doesn't take correctly in account the possibility of JavaScript being disabled on about:blank, as you can easily verify by uninstalling NoScript and unchecking the "Content|Enable JavaScript" box in Firefox's options.

Therefore this is t be considered a View Source Chart bug, because the proper way to execute scripts for an extension independently of content JavaScript permissions is either attaching the event handler from chrome or using Components.utils.Sandbox.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
Post Reply