noellarkin
Senior Member
- Mar 14, 2021
- 1,006
- 1,492
Trying to write some greasemonkey scripts to replace browser plugins, this one being for fingerprint parameters.
Example, for screen resolution:
Object.defineProperty(Screen.prototype, "width", {get: (() => 1366).bind(null)});
Object.defineProperty(Screen.prototype, "height", {get: (() => 768).bind(null)});
A few doubts:
1. how does this work in pages with iframes? Do I have to enumerate all the frames and then inject the script into all of them?
2. I've heard of something called exportFunction() being used as a substitute for this, but not sure how to go about using it.
3. Is there a more "global" way to run these scripts so they apply to the browser profile as a whole (like about:config changes to useragent etc)
4. I can inject this before every page load but how do I deal with dynamic pages?
Example, for screen resolution:
Object.defineProperty(Screen.prototype, "width", {get: (() => 1366).bind(null)});
Object.defineProperty(Screen.prototype, "height", {get: (() => 768).bind(null)});
A few doubts:
1. how does this work in pages with iframes? Do I have to enumerate all the frames and then inject the script into all of them?
2. I've heard of something called exportFunction() being used as a substitute for this, but not sure how to go about using it.
3. Is there a more "global" way to run these scripts so they apply to the browser profile as a whole (like about:config changes to useragent etc)
4. I can inject this before every page load but how do I deal with dynamic pages?