sorz / accept-language-per-site

Firefox extension to change Accept-Language for different sites.
MIT License
23 stars 0 forks source link

global domain settings #1

Closed ghost closed 6 years ago

ghost commented 6 years ago

Thank you for this extension!

I was trying to set a global approach with the wildcard but either way I tried it did not work.

1 host * (global) / a-l FR (as an example) 2 host *.uk (localized) / a-l GB

In this scenario (1) takes precedence over everything and (2) is not applied. Alternatively tried

1 host *.* (global) / a-l FR 2 host *.uk (localized) / a-l GB

In this scenario (1) is not applied at any domain/host but only (2)

sorz commented 6 years ago

The global languages can be set on about:preferences.

Match patterns are directly passed to the browser's API: wildcard can only be the beginning and followed by a dot, so *.* won't work.

I didn't consider the scenario when rules are overlapping. Did you try change the order of rules?

ghost commented 6 years ago

My point of using this extension is to escape browser sniffing with the NavigatorLanguage.language API This API is overriding the header and thus I hope that with the other browser extension the API can be stopped and the header becoming the sole source of language information.

Hence I was looking for a global setting and then to cascade localized settings whenever needed.

Yes, tested the order of rules but * takes always precedence, whether top or bottom of the order. I had hoped for a logic of weighing the specifics of the domain declaration, e.g. *.uk is more specific than * and thus *.uk takes precedence over *

sorz commented 6 years ago

I see. It's possible but requires change the extension to intercept all requests and implement rule matching by ourself. I will look into it later.

ghost commented 6 years ago

Just a quick thank you for the instant patch! Love it and rated it already 5* at AMO