PopupVideo icon indicating copy to clipboard operation
PopupVideo copied to clipboard

Window Size and privacy.resistFingerprinting

Open maverick74 opened this issue 5 years ago • 11 comments

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 avatar Apr 11 '19 08:04 maverick74

@maverick74 there are three solutions:

  1. 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.

  1. Add 4 option fields, user can input their screen width, height, top and left manually.
  2. 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?

ettoolong avatar Apr 13 '19 09:04 ettoolong

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 avatar Apr 15 '19 09:04 maverick74

@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?

ettoolong avatar May 07 '19 08:05 ettoolong

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)?

maverick74 avatar May 07 '19 10:05 maverick74

Update v 0.0.8 to fix this issue.

ettoolong avatar May 08 '19 12:05 ettoolong

@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...

maverick74 avatar May 08 '19 16:05 maverick74

@ettoolong ?!?!?! Hum??? Did i just broke GitHub or something??? How the h*** did my last comment ended up above yours???

maverick74 avatar May 08 '19 17:05 maverick74

@maverick74 you can follow below steps:

  1. open add-on option page and check the screen settings (width/height/left/top)
  2. disable privacy.resistFingerprinting in about:config
  3. click Auto detect button, that will update the screen settings
  4. enable privacy.resistFingerprinting in about:config

ettoolong avatar May 09 '19 04:05 ettoolong

@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...

maverick74 avatar May 09 '19 09:05 maverick74

@ettoolong anything new about this bug?

maverick74 avatar Jul 01 '19 16:07 maverick74

no, sorry for that. :(

ettoolong avatar Jul 25 '19 10:07 ettoolong