PopupVideo
PopupVideo copied to clipboard
Window Size and privacy.resistFingerprinting
If, in about:config, the key privacy.resistFingerprinting is set to True, the addon cannot set the popup window size neither it's position.
(probably because it can't get screen size...)
Position won't probably have a workaround, but what about window size?
@maverick74 there are three solutions:
- When add-on loaded, disable resistFingerprinting => detect screen => enable resistFingerprinting again.
browser.privacy.websites.resistFingerprinting.get({})
.then((got) => { // get resistFingerprinting setting
const levelOfControls = [
'controllable_by_this_extension',
'controlled_by_this_extension'
];
if (got.value === true && levelOfControls.includes(got.levelOfControl)) {
browser.privacy.websites.resistFingerprinting.set({value: false}) // disable it
.then(() => {
screen = {
width: window.screen.width,
height: window.screen.height,
top: window.screen.top,
left: window.screen.left,
}; // get screen top, left, width and height
browser.privacy.websites.resistFingerprinting.set({value: true}) // enable it again
.then(() => {});
});
} else {
screen = {
width: window.screen.width,
height: window.screen.height,
top: window.screen.top,
left: window.screen.left,
}; // get screen top, left, width and height
}
});
this solution need one more permission "privacy" when install add-on.
- Add 4 option fields, user can input their screen width, height, top and left manually.
- combine 1&2, Add 4 option fields and a button. when button click, ask privacy permission temporarily( see: optional_permissions and permissions.request() ). detect screen and save them, then remove permission (see: permissions.remove())
Let me know if you have more ideas?
Number 3 looks great. It's actually near what i imagined (in the mean time) as a workaround, but better :)
From what i understand, this would allow users to: 1.either set the values manually or 2. to get them automatically by granting privacy permission to the addon (for those who prefer it)
If i understood it right, then it seems option 3 would be the way to go! :)
thanks @ettoolong :)
@maverick74 Sorry for the late reply, according to the document, the privacy permission can't be optional.
BTW, the Number 1 is the only solution. Any ideas on this issue?
Well... between "1" and not working, i surely prefer "1" :).
I assume that, to detect screen, it will disable>enable resistFingerprinting only for the first time it runs, right (or manually at user's request)?
Update v 0.0.8 to fix this issue.
@ettoolong window positioning does not work as it should.
I've have it set to place the window on bottom-right, but it places' it on top, somewhere near the center...
@ettoolong ?!?!?! Hum??? Did i just broke GitHub or something??? How the h*** did my last comment ended up above yours???
@maverick74 you can follow below steps:
- open add-on option page and check the screen settings (width/height/left/top)
- disable privacy.resistFingerprinting in about:config
- click Auto detect button, that will update the screen settings
- enable privacy.resistFingerprinting in about:config
@ettoolong nop... not working! :(
As soon as i enable privacy.resistFingerprinting, with the addon set to place the window on bottom-right, it places the popup window 10px from top and 912px from left (in a screen with 1920*1080)
edit: oh, and i'm on Linux...
@ettoolong anything new about this bug?
no, sorry for that. :(