Open Bug 1649050 Opened 4 years ago Updated 1 year ago

privacy.resistFingerprinting prevents WebExtensions from sizing their windows

Categories

(WebExtensions :: Untriaged, defect, P3)

77 Branch
defect

Tracking

(firefox78 affected, firefox79 affected, firefox80 affected)

Tracking Status
firefox78 --- affected
firefox79 --- affected
firefox80 --- affected

People

(Reporter: B00ze64, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0

Steps to reproduce:

resistFingerprinting is making it hard for AddOns to create correctly sized windows. I discovered this for two AddOns so far, but I expect more are affected. Tested AddOns:

[1] Bookmark Search Plus 2
https://addons.mozilla.org/en-US/firefox/addon/bookmark-search-plus-2/
[2] ImTranslator
https://addons.mozilla.org/en-US/firefox/addon/imtranslator/

Make sure Resist Fingerprinting is enabled before testing.

Actual results:

*)=result

For BSP2 [1]:

a) open the AddOn's settings and select to remember windows size and positions.
b) Close settings and open the sidebar at the BSP2 node.
c) Right-Click on a bookmark and select properties ->
*) Properties Window flashes badly and goes top-left of the screen.
d) Don't touch it, just Close it.
e) Right-Click on a bookmark and select properties ->
*) Properties Window flashes badly and goes top-left of the screen SMALLER.
f) Don't touch it, just Close it.
g) Right-Click on a bookmark and select properties ->
*) Properties Window flashes badly and goes top-left of the screen EVEN SMALLER.

Basically the window is unable to position itself correctly (if you move it before closing it each time, it will not go back to where you left it) and the AddOn calculates the window size smaller and smaller every time you open it. If we disable Resist Fingerprinting none of this happens. See https://github.com/aaFn/Bookmark-search-plus-2/issues/148.

For ImTranslator [2]:

a) install the AddOn
b) open some webpage you want to translate from
c) highlight a couple words
d) Right-Click and select ImTranslator -> ImTranslator
*) The window opens almost fullscreen

It's important to select that one (ImTranslator) as the other modules do not open a window so they are not affected. When Resist Fingerprinting is disabled the AddOn correctly sizes and positions the ImTranslator window.

Expected results:

As a user, I do not expect Resist Fingerprinting to affect AddOns, what would be the point? As more and more is added behind that pref, if AddOns are not isolated from this, more and more will have undesired behaviour. I've only noticed window positioning so far but there could be more stuff broken...

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Product: Firefox → WebExtensions

While RFP is not intended to affect add-ons, itpresently does and we are trying to find time to address that. However Window Sizing affects more than add-ons, it affects web content, and it doesn't seem possible to know whether a window will 'just' be used for an add-on or if it could load web content too. I'm not sure what we could do to resolve it, but we can track it and investigate more in the future.

Good day. I am unfamiliar with opening of windows, but it seems to me an addOn should be able to get the real Firefox window position/dimensions instead of the spoofed ones, and correctly size/position its window(s) during the call to open them. If scripts/CSS running inside that window get faked dimensions afterwards then stuff may look strange, but I've been told that simply opening the window correctly is difficult, and that the workaround is to move/resize the window after opening it, which might be part of the problem. If you know of a way for an addOn to open a window to a desired size/position, something that might not be obvious to most, then please describe the method here. I did find one addOn that manages to open correct windows -> DownThemAll, so it seems there is a way to do it. Thank you.

Severity: -- → S3
Priority: -- → P3

Hi Sylvain,

Thank you for taking the time to submit this bug report. Testing was done on Windows 10 x 64 bit and MacOS 10.14 with Nightly 80.0a1 (20200708094217), Beta 79.0b5 (20200708005253) and Release 78.0.1 (20200630195452) with all three add-ons that you mentioned.

Indeed I managed to reproduce the issue with Bookmark Search Plus 2 and ImTranslator on all the above Firefox versions, by using the described steps. Please note though that on Mac, if "privacy.resistFingerprinting" is set to "false", the Properties Window for Bookmark Search Plus 2 still changes size and position, but it's the other way around, the window increases in size until it's full-screen.

For the DownThemAll! add-on (https://addons.mozilla.org/en-US/firefox/addon/downthemall/), if no changes are made to the window, "privacy.resistFingerprinting" is set to "true" and once on a webpage, the add-on toolbar button and then the "DownThemAll!" button are clicked several times, the position and size of the displayed add-on window will not change.

Status: UNCONFIRMED → NEW
Ever confirmed: true

The Author of Bookmark Search Plus 2 has fixed some of the issues, the properties window no longer grows or shrinks, but he still uses window position and screen size to determine when the window opens off-screen, and resistFingerprinting is making this difficult. He says:

"In resist finger printing mode, the Screen interface https://developer.mozilla.org/en-US/docs/Web/API/Screen behaves wrongly, it returns the size of the sidebar and not the size of the screen. I need the size of the screen to relocate the property window when for some reason it gets out of the screen. That can happen when people change resolution or have multiple screens and remove one of the screens for example. In such cases, when I detect that the property window is getting out of sight partially or fully, I need to calculate new coordinates function of the screen size to put it back in visible space. I found no indicator telling me that the user activated privacy.resistFingerprinting, so I cannot disable that recalculation in that mode."

Some of the related/duplicate bugs:
https://bugzilla.mozilla.org/show_bug.cgi?id=1448848
https://bugzilla.mozilla.org/show_bug.cgi?id=1560816

Some more observations by the Bookmark Search Plus 2 Author and I: When we use resistFingerprinting, the properties window he opens starts off BIG, we can clearly see a window open that is almost as big as the browser, and then it resizes itself to the correct size that he requested. He says this behaviour is specific to when resistFingerprinting is enabled.

You need to log in before you can comment on or make changes to this bug.