From 50d3154daa3c6765eec879d1cb08f3803fee13cd Mon Sep 17 00:00:00 2001 From: Thorin-Oakenpants Date: Tue, 14 Jan 2020 00:04:21 +0000 Subject: [PATCH] Updated 4.2.1 User Scripts (markdown) --- 4.2.1-User-Scripts.md | 50 +------------------------------------------ 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/4.2.1-User-Scripts.md b/4.2.1-User-Scripts.md index 2735d1f..ab4d649 100644 --- a/4.2.1-User-Scripts.md +++ b/4.2.1-User-Scripts.md @@ -35,7 +35,7 @@ if (window.opener !== null) { --- -### :small_orange_diamond: Conceal history.length +### :small_orange_diamond: Conceal window.name * Author: [earthlng](https://github.com/earthlng) * Description: This does not break history in any way. It just lies to any JS asking about it @@ -79,51 +79,3 @@ descriptor.set = exportFunction(Object.getOwnPropertyDescriptor(fakeobj, 'name') Reflect.defineProperty(unsafeWindow, 'name', descriptor); ``` ---- - -### :small_orange_diamond: Conceal window.name - -👼 Don't use this. Instead use [CanvasBlocker](https://addons.mozilla.org/en-US/firefox/addon/canvasblocker/), which supports `window.name` protection without leaking the custom function (see "Window API" and [how to unbreak reCaptcha](https://github.com/kkapsner/CanvasBlocker/issues/231#issuecomment-416919273)) - -
'Conceal window.name' userscript

- - * Author: Chris Rider - * Description: See [bugzilla 444222](https://bugzilla.mozilla.org/show_bug.cgi?id=444222) - * Test: [JonDonym](http://ip-check.info/?lang=en) - * Note: you need to add `http://ip-check.info/?lang=en` as an exception. This is the landing page with the "Test" link on it. Without this exception you cannot do the test. To add an exception go to your User Script and click Options and add it under "Excluded Pages" - * reported breakage: *may* interfere with Google's reCAPTCHA (the script is now 3 years old) - * reported breakage (3rd party): paypal, disqus (just add exceptions) - -```js -// ==UserScript== -// @name Conceal window.name -// @description Intercepts read access to window.name property. -// @namespace localhost -// @include * -// @run-at document-start -// @version 1.0.1 -// @grant none -// ==/UserScript== - -var _window={name:window.name}; -Object.defineProperty(window,'name',{ - get:function() - { - //No CAPTCHA reCAPTCHA - if(/^https:\/\/www\.google\.com\/recaptcha\/api2\/(?:anchor|frame)\?.+$/.test(window.location.href)&&/^I[0-1]_[1-9][0-9]+$/.test(_window.name)) - { - return _window.name; - } - else - { - if(_window.name!='') - { - console.warn('Intercepted read access to window.name "'+_window.name+'" from '+window.location); - } - return ''; - } -} -}); -``` -

-