Discussions » Développement

change ff preference value on a per-domain basis - possible?

§
Posté le: 10/04/2015

change ff preference value on a per-domain basis - possible?

wondering is gm can be used to set a ff preference value per-domain? basically i want to set a global value, then toggle it when visiting a certain domain(s), then toggle back again when another domain is loaded or the tab is x'd, etc...

spotted this which i thought might help...

// ==UserScript==
// @name Change navigator.userAgent
// @namespace Rob W
// @description Changes navigator.userAgent to IE on IEGallery.com
// @match http://www.iegallery.com/*
// @run-at document-start
// @grant none
// @version 1
// ==/UserScript==

Object.defineProperty(navigator, 'userAgent', {
value: 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)'
});

woxxomMod
§
Posté le: 10/04/2015

Can you use UAControl addon instead?

§
Posté le: 10/04/2015

i could - if i were changing the UA - but i'm not :)
i just posted the code above as an example that i thought might be useful
i'm actually trying to toggle "dom.event.clipboardevents.enabled" since i see that as a security/privacy risk, so i want to global "false" it, then "true" it on my site since it breakes functionality of WP TinyMCE ed

woxxomMod
§
Posté le: 10/04/2015

AFAIK userscripts can't modify Firefox preferences, here's a quote from Greasespot wiki:

Scripts are considered to exist in a space between untrusted content like web pages and fully trusted content such as extensions. Thus, their special permissions are limited to the chrome-level privileges exposed by the GM* API, like cross-domain XMLHttpRequest and persistence via GMsetValue(). You’ll have to write a full extension to make use of chrome-only features.

§
Posté le: 10/04/2015

i read that too, but wasn't sure whether the prefs fell under the "chrome" stuff
thanks :)

Poster une réponse

Connectez-vous pour poster une réponse.