Open Bug 1795449 Opened 2 years ago Updated 4 months ago

onOpenOptionsPage doesn't actually trigger a page load

Categories

(Fenix :: WebExtensions, defect, P3)

All
Android

Tracking

(Not tracked)

People

(Reporter: csadilek, Assigned: m_kato)

Details

Attachments

(2 files)

From github: https://github.com/mozilla-mobile/android-components/issues/11182.

STR:

  1. Install 10ten Japanese Reader using the following collection details:
    Collection owner (user ID): 6693726
    Collection name: japanese
  2. Enable the extension
  3. Load a page with Japanese text, e.g. https://ja.wikipedia.org/
  4. Drag the "puck" so that some Japanese text is highlighted and popup window shows
  5. Press the settings icon in the top-right of the popup

Expected results:

The options page is loaded in a new tab.

Actual results:

A new tab is opened with the options URL filled in the location, but it is not loaded.

If you open the location bar and press "Enter" / "Go" etc., however the page loads successfully.

Furthermore, if you open the options page from the menu it loads successfully.

(Note that the options page is currently not scrollable but that is a bug in the add-on itself and has been fixed upstream.)

Video:

https://user-images.githubusercontent.com/1232595/139200056-e490142d-9c82-47cd-9d20-94f12246ae08.mp4

Notes:

This add-on does not set open_in_tab so the options page should be loaded using the onOpenOptionsPage handler added in eed463d931206f3eb49edc864aa09c5888b4cf09 (see #7397).

At a guess, I wonder if instead of passing false as the active flag to onNewTab we should be passing true, here:

https://github.com/mozilla-mobile/android-components/blob/04bd14f2a3b5bea15641e03c8794303c02e3a243/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/webextension/GeckoWebExtension.kt#L278-L290

Note that the operation of this add-on is:

┆Issue is synchronized with this Jira Task

Change performed by the Move to Bugzilla add-on.

The severity field is not set for this bug.
:cpeterson, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(cpeterson)
Severity: -- → S3
Flags: needinfo?(cpeterson)
Attached file openOptionsPage.zip

I created a minimal extension to reproduce the problem.

  • Unzip openOptionsPage.zip
  • Load it in Firefox Android
  • Open popup
  • Click Open options button
  • The options page opens in a new tab, but the page remains blank. If you reload the page, it will be displayed (with the title Options).
Priority: -- → P3

(Regarding the original report, I've temporarily disabled the settings bug in the 10ten Japanese Reader extension on Android until this is fixed. Please refer to the STR in comment 2 instead when testing.)

I guess that tabHandler.onNewTab just open new Tab, but it doesn't call GeckoSesison.loadUri. So onOpenOptionsPage should call EnglineSession.loadUrl after calling onNewTab.

Assignee: nobody → m_kato

The current implementation of onOpenOptionsPage in A-C is incorrect, and even the proposed one at https://github.com/mozilla-mobile/firefox-android/pull/4789 does not behave as expected.

The expected behavior is to open the embedded options page (if open_in_tab is false, which is the default). To see the desired effect, visit the Add-ons Manager, and click on the Settings page of an add-on that has options_ui.page set without options_ui.open_new_tab. An example of such an add-on that is Android-compatible is https://addons.mozilla.org/en-US/android/addon/dont-track-me-google1/

Upon clicking "Settings", the "[addon title]" banner stays at the top, and the options page is still loaded. The "back" button goes back to the individual Add-ons management view. This is implemented at https://searchfox.org/mozilla-mobile/rev/ab420b41bfcfb41d5c3c12c4b412056108bf1108/firefox-android/fenix/app/src/main/java/org/mozilla/fenix/addons/InstalledAddonDetailsFragment.kt#285-303

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

Attachment

General

Created:
Updated:
Size: