mirror of
https://github.com/arkenfox/user.js.git
synced 2025-11-08 01:25:25 +01:00
Updated 3.1 User Scripts (markdown)
@@ -3,7 +3,7 @@ Use [Greasemonkey](https://addons.mozilla.org/en-Us/firefox/addon/greasemonkey/)
|
|||||||
|
|
||||||
### Conceal history.length
|
### 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.
|
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.
|
||||||
<br>You can test it at [JoDonym](http://ip-check.info/?lang=en)</br>
|
<br>You can test it at [BrowserSpy.dk](http://browserspy.dk/document.php)</br>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
@@ -16,9 +16,17 @@ This does not break history in any way. It just lies to any JS asking about it.
|
|||||||
// @grant none
|
// @grant none
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|
||||||
|
let _history={length:history.length};
|
||||||
Object.defineProperty(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
|
### Conceal window.name
|
||||||
|
|||||||
Reference in New Issue
Block a user