[RESOLVED] WebScreenShot.uc.xul blocked

Ask for help about NoScript, no registration needed to post

[RESOLVED] WebScreenShot.uc.xul blocked

Postby Endor » Wed Jan 23, 2013 5:09 pm

Hi.
I use Firefox 18.01, NoScript 2.6.44rc2 and Windows 7 Home
I use the Script WebScreenShot.uc.xul from here:
https://github.com/Griever/userChromeJS/blob/master/WebScreenShot.uc.xul

with NoScript activated it not work and the NoScript Symbol looks so:

Image

If I disable NoScript, it works.
What can I do that it works, or is this a bug in NoScript?

Thank you for any help.
Cheers
Endor
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0.1
OS: Windows 7 Home Premium My Versions Info 23.01.2013
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0
User avatar
Endor
 
Posts: 11
Joined: Sun Jun 07, 2009 1:38 pm
Location: Somewhere in Space

Re: WebScreenShot.uc.xul blocked

Postby Tom T. » Thu Jan 24, 2013 4:48 am

Hi,

Before investigating the issue, please note that third-party add-ons from sources other than Firefox Add-ons are more likely to be problematical. Mozilla add-ons is not perfect, but they have been trying harder to ensure safety, and perhaps compatibility. If you are seeking an add-on to capture screenshots, a search of Firefox Add-ons showed a number of add-ons that claim to do this. Perhaps this would solve the problem?

Also please note that anything from a Github repository could theoretically contain malicious code uploaded by any user.

Can any of the "official" add-ons do the function you desire?
Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0
Tom T.
Field Marshal
 
Posts: 3632
Joined: Fri Mar 20, 2009 6:58 am

Re: WebScreenShot.uc.xul blocked

Postby Endor » Thu Jan 24, 2013 9:59 am

Hi Tom T.
Thank you for your answer.
Your right, Add-ons or Scripts from anywhere else than https://addons.mozilla.org,
could contain malicious content. This is a script, which provide the
same functionality as an add-on. This script not only made Screen-shots, but
also contains a base64 encoder for images. The encoder works well.

Only the screen-shot part is blocked in part by NoScript.
This script adds a sub-menu to the Tools menu, with 4 menu entries to make
screen-shots. When you click on one of this entries the script made a screen-shot
and opens the image in a new tab. Whit NoScript enabled the New Tab is empty.
No image there. Nothing to save.
I hope you or Giorgio are able to help me.
Cheers
Endor
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0.1
OS: Windows 7 Home Premium My Versions Info 23.01.2013
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0
User avatar
Endor
 
Posts: 11
Joined: Sun Jun 07, 2009 1:38 pm
Location: Somewhere in Space

Re: WebScreenShot.uc.xul blocked

Postby Giorgio Maone » Thu Jan 24, 2013 7:44 pm

The problem is about:blank being JavaScript disabled whenever a CAPS policy is in effect (it seems a Firefox bug introduced in Firefox 4 or so, but there's no incentive to fix it).

You (and the script's author) can work-around by modifying the capture method this way:
Code: Select all
capture: function(win, x, y, w, h) {
    var tab = gBrowser.addTab("about:support");
    var browser = gBrowser.getBrowserForTab(tab);
    browser.addEventListener('load', function(event) {
    browser.removeEventListener('load', arguments.callee, true);
        var doc = browser.contentDocument;

        doc.head.innerHTML = doc.body.innerHTML=""
       
        var canvas = doc.body.appendChild(doc.createElement('canvas'));
       
        canvas.style.border = "1px solid red"
        canvas.width = w;
        canvas.height = h;
        var ctx = canvas.getContext("2d");
        ctx.drawWindow(win, x, y, x + w, y + h, "rgb(255,255,255)");
        gBrowser.selectedTab = tab;

    }, true);
}
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0
User avatar
Giorgio Maone
Site Admin
 
Posts: 6775
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy

Re: WebScreenShot.uc.xul blocked

Postby Endor » Thu Jan 24, 2013 7:57 pm

Hi Giorgio.
Thank you very much for your help.
I modified the Script like you suggested, and it works perfect!
Image

Cheers
Endor
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0.1
OS: Windows 7 Home Premium My Versions Info 23.01.2013
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0
User avatar
Endor
 
Posts: 11
Joined: Sun Jun 07, 2009 1:38 pm
Location: Somewhere in Space


Return to NoScript Support

Who is online

Users browsing this forum: Google [Bot] and 6 guests