From 32e782cc22b04a946d3adeb7d340de98f8f095ba Mon Sep 17 00:00:00 2001 From: earthlng Date: Tue, 14 Mar 2017 20:18:14 +0100 Subject: [PATCH] Updated 3.1 User Scripts (markdown) --- 3.1-User-Scripts.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/3.1-User-Scripts.md b/3.1-User-Scripts.md index 19103d7..47934e5 100644 --- a/3.1-User-Scripts.md +++ b/3.1-User-Scripts.md @@ -3,7 +3,7 @@ Use [Greasemonkey](https://addons.mozilla.org/en-Us/firefox/addon/greasemonkey/) ### Conceal history.length This does not break history in any way. It just lies to any JS asking about it. Your actual (max) history is controlled by `browser.sessionhistory.max_entries` which is a per tab setting. -
You can test it at [JoDonym](http://ip-check.info/?lang=en)
+
You can test it at [BrowserSpy.dk](http://browserspy.dk/document.php)
```js // ==UserScript== @@ -16,9 +16,17 @@ This does not break history in any way. It just lies to any JS asking about it. // @grant none // ==/UserScript== +let _history={length:history.length}; Object.defineProperty(history,'length',{ - get: function() { return 2; } + get: function() { + if (_history.length > 2) { + return 2; + } else { + return _history.length; + } + } }); + ``` ### Conceal window.name