Open Bug 1905471 Opened 3 months ago Updated 1 month ago

browser.windows.update() on Linux has no effect

Categories

(WebExtensions :: General, defect)

Firefox 127
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: alex, Unassigned, NeedInfo)

Details

Steps to reproduce:

In a recent version of my Firefox extension, Clippings, I added a call to browser.windows.update() prior to sending a message to the content script to insert a clipping into the web page textbox. This is intended to force the browser window to take the focus, which is necessary for when an extension page was opened in a popup window prior to the insertion, so that the content script is able to locate the active element in the web page (the text box) where it will perform the clipping insertion.

But on Linux, the WebExtension API call to browser.windows.update() doesn't appear to have any effect. No errors appear in the developer tools console. This is NOT occurring on Windows or macOS.

Permalink to the line in the background script where the call to browser.windows.update() occurs:
https://github.com/aecreations/clippings/blob/c350f4e141f3d06548ddb7afb7ab663dba40c23a/wx-src/background.js#L1714

I've confirmed that the issue is reproducible on Ubuntu 22.04 beginning in Firefox 121 (user agent string: Mozilla/5.0 (X11; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0). Users of my extension have reported this on Ubuntu 20.04.5 LTS and OpenSUSE 15.5.

Steps to reproduce:

  1. On Firefox on Linux, install Clippings version 6.5.6 from here: https://github.com/aecreations/clippings/releases/tag/6.5.6
  2. Open Clippings Manager and create a clipping with a placeholder. When the clipping is inserted, a window will open to prompt for text to fill in for the placeholder. Example clipping file that can be imported:
    https://github.com/aecreations/clippings/blob/master/test/clippings6.1.json
  3. Navigate to a web page with a textbox. For a simple example for testing purposes, save this HTML file to your computer and open it in the browser:
    https://github.com/aecreations/clippings/blob/master/test/textfields.html
  4. Right-click on the textbox in the web page. In the browser context menu, click the Clippings menu and select a clipping with one or more placeholders from the submenu
  5. A popup window should appear, prompting to fill in the value for the placeholder in the clipping
  6. Fill in the placeholder value and then click OK to dismiss the popup window

Actual results:

No text is inserted into the textbox on the web page.

Expected results:

Once the popup window is closed, the clipping text with the filled-in placeholder should be inserted into the web page textbox.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

Not sure which component is that but not Core / Widget / Gtk.

Component: Widget: Gtk → Extension Compatibility
Product: Core → Firefox

I am unable to reproduce the issue you are reporting in Firefox 129 on ArchLinux.

The browser.windows.update(windowId, { focused: true }) call is supposed to focus a window if it was not focused before. It is not clear how that would relate to the issue you are reporting. Could you create a minimal test case that reproduces the issue?

Component: Extension Compatibility → General
Flags: needinfo?(alex)
Product: Firefox → WebExtensions
You need to log in before you can comment on or make changes to this bug.