Hi everyone,
I’m developing an Android app that embeds GeckoView and uses a WebExtension. I need to modify some internal pages, specifically pages loaded via chrome:// and about:xxx protocols (for example, about:config, whose underlying URL appears to be chrome://geckoview/content/config.xhtml).
What I need to do on those pages:
- change some specific text in the page;
- adjust the zoom level.
I’ve tried declaring a content script with matches: [“<all_urls>”], but it does not seem to be injected into pages using resource:// or chrome://. From what I understand, standard WebExtensions are generally not allowed to run content scripts on privileged/internal pages.
My questions are:
1. In GeckoView on Android, is there any supported way for a WebExtension to inject scripts into chrome:// or about:xxx pages?
2. If WebExtensions cannot do this, are there any other approaches? For example, can I achieve it by operating on GeckoView directly, such as using GeckoSession/GeckoRuntime APIs? If yes, which APIs or mechanisms should I use?
3. Can the zoom level of these internal pages be changed from a WebExtension or from the embedding app? If so, which API should be used? For example, is browser.tabs.setZoom supported for such pages, or should I use a GeckoView API such as setZoomFactor?
4. If this is not supported by design, what is the recommended alternative?
Any documentation, examples, or advice would be greatly appreciated. If this is not supported by design, please let me know what the recommended alternative is.
Thank you!