Page 1 of 1

Enable right click?

Posted: Sun Dec 25, 2016 6:15 pm
by harryray2
Is there any way, with noscript, to enable right click on sites that have restricted it...For example pictures on facebook my 2search google images2 and save picture as" is disabled.

Thanks.

Re: Enable right click?

Posted: Sun Dec 25, 2016 6:21 pm
by barbaz
Should be possible to make surrogate script for that, but I'm not quite sure what JS.

Why with NoScript? Does it work to just set about:config > dom.event.contextmenu.enabled to false ?

Re: Enable right click?

Posted: Sun Dec 25, 2016 6:32 pm
by harryray2
No, tried that, doesn't work....

Re: Enable right click?

Posted: Mon Dec 26, 2016 6:12 pm
by barbaz
Try this code (from http://lexi.ucoz.ru/buttons.html#firefox, thanks fatboy for converting to surrogate).

go to about:config
right-click > new > string
name:

Code: Select all

noscript.surrogate.restore_contextmenu.replacement
value:

Code: Select all

(function(w){var arr = ['contextmenu','copy','cut','paste','mousedown','mouseup','beforeunload','beforeprint']; for(var i = 0, x; x = arr[i]; i++){if(w['on' + x])w['on' + x] = null; w.addEventListener(x, function(e){e.stopPropagation()}, true);}; for(var j = 0, f; f = w.frames[j]; j++){try{arguments.callee(f)}catch(e){}}})(content);
right-click > new > string
name:

Code: Select all

noscript.surrogate.restore_contextmenu.sources
value is "@" followed by the list of sites where you want your context menu back, written in ABE syntax. See ABE Rules .pdf for details.
Example:

Code: Select all

@.google.com .facebook.com

Re: Enable right click?

Posted: Mon Dec 26, 2016 9:36 pm
by harryray2
Just realised, one of the problems is that noscript has to be disabled as it appears that facebook wont run without Java!!

Re: Enable right click?

Posted: Mon Dec 26, 2016 10:08 pm
by harryray2
Tried it, didn't work....If, on firefox, I switch from basic page style to no style, right click then works on the pictures.

Re: Enable right click?

Posted: Mon Dec 26, 2016 10:29 pm
by barbaz
Do you use Stylish?

Re: Enable right click?

Posted: Mon Dec 26, 2016 10:31 pm
by harryray2
No, I just used option in the Firefox view menu

Re: Enable right click?

Posted: Mon Dec 26, 2016 10:39 pm
by barbaz
Please try this -

1) Install Stylish from the above link
2) Go to the problemstic site
3) Stylish button > Write new style. Select the option immediately above "Blank style".
4) inside the @-moz-document block, paste this -

Code: Select all

  * { pointer-events: auto !important; }
5) Click Preview and check if right-click now works.

If still no dice, please provide an exact URL to a problematic google images search page, and explain which image(s) cannot be right-clicked.

Re: Enable right click?

Posted: Tue Dec 27, 2016 11:58 am
by harryray2
Below is what comes up in stylish....Where do I insert * { pointer-events: auto !important; } ?

Code: Select all

@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document domain("facebook.com") {

}
The problem I'm having on sites like Facebook, Tumblr etc is that when I right click on any of the images (in Facebook, the images on the timeline) options are missing such as 'search image by Google' (which is an addon) and 'save image as' etc.

Re: Enable right click?

Posted: Tue Dec 27, 2016 6:38 pm
by barbaz

Code: Select all

@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document domain("facebook.com") {
  * { pointer-events: auto !important; }
}

Re: Enable right click?

Posted: Wed Dec 28, 2016 7:53 pm
by harryray2
Thanks, but that didn't work either...

Re: Enable right click?

Posted: Wed Dec 28, 2016 8:10 pm
by barbaz
So can you please post the URL to a page where you see this problem?

If it's only on facebook and these social network type sites, I won't be able to help more as they're all blocked here. Someone else might be able to though.