Updated 4.2.1 User Scripts (markdown)

Thorin-Oakenpants 2020-01-14 00:04:21 +00:00
parent 6fefbf769b
commit 50d3154daa

@ -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) * Author: [earthlng](https://github.com/earthlng)
* Description: This does not break history in any way. It just lies to any JS asking about it * 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); 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))
<details><summary>'Conceal window.name' userscript</summary><p>
* 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 '';
}
}
});
```
</p></details>