The API browser.runtime.openOptionsPage does not display the page
Categories
(Thunderbird :: Add-Ons: Extensions API, defect, P2)
Tracking
(Not tracked)
People
(Reporter: ysard_git, Assigned: rnons)
Details
Attachments
(1 file)
1.05 KB,
patch
|
darktrojan
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0
Steps to reproduce:
I'm on Thunderbird beta 65.0b4.
The API runtime is supposed to be as it is in Firefox according to this page:
https://thunderbird-webextensions.readthedocs.io/en/latest/index.html?highlight=runtime
Let's do a simple background-script.js as shown on the page:
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/openOptionsPage
function onOpened() {
console.log(Options page opened
);
}
function onError(error) {
console.log(Error: ${error}
);
}
var opening = browser.runtime.openOptionsPage();
opening.then(onOpened, onError);
With the following manifest.json:
{
"description": "Show Options page example",
"manifest_version": 2,
"name": "Show Options page example",
"version": "1.0",
"icons": {
"48": "icons/message.svg"
},
"applications": {
"gecko": {
"id": "options_page@example.org",
"strict_min_version": "50.0"
}
},
"background": {
"scripts": ["background.js"]
},
"options_ui": {
"page": "options.html",
"open_in_tab": true
}
}
Actual results:
The console outputs the following stacktrace:
openOptionsPage is not defined ext-runtime.js:133
openOptionsPage chrome://extensions/content/parent/ext-runtime.js:133
openOptionsPage self-hosted:972
result resource://gre/modules/ExtensionParent.jsm:947
withPendingBrowser resource://gre/modules/ExtensionParent.jsm:601
InterpretGeneratorResume self-hosted:1255
next self-hosted:1210
result resource://gre/modules/ExtensionParent.jsm:946
withTiming resource://gre/modules/ExtensionParent.jsm:913
InterpretGeneratorResume self-hosted:1255
next self-hosted:1210
call resource://gre/modules/ExtensionParent.jsm:945
InterpretGeneratorResume self-hosted:1255
next self-hosted:1210
Error: Error: An unexpected error occurred background.js:7:5
Expected results:
The options.html page should open in a Thunderbird tab, as is the case under Firefox.
Thank you for reading.
Hi, this issue is still present on 67.0a1 nightly.
This is quite annoying since it prevents access to options from the interface of an addon.
Note: The options page is only accessible from the "Add-ons Manager" tab.
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 3•1 year ago
|
||
- Copied
global.openOptionsPage
from https://searchfox.org/mozilla-central/source/browser/components/extensions/parent/ext-browser.js#107-125 toext-mail.js
- Updated
window.BrowserOpenAddonsMgr(viewId)
towindow.openAddonsMgr(viewId)
Comment 4•1 year ago
|
||
Comment on attachment 9138732 [details] [diff] [review] 1526802-openOptionsPage.patch Thank you. This works well.
Updated•1 year ago
|
Comment 5•1 year ago
•
|
||
Can someone please provide a complete HG header here. We need a something like:
# User Ping Chen <remotenonsense@gmail.com>
You can put
[ui]
username =
into your mercurial.ini file. for future patches.
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/7e335f6ec503
add openOptionsPage function to ext-mail.js. r=darktrojan
Updated•1 year ago
|
Assignee | ||
Comment 7•1 year ago
|
||
(In reply to Jorg K (CEST = GMT+2) from comment #5)
Can someone please provide a complete HG header here. We need a something like:
# User Ping Chen <remotenonsense@gmail.com>
You can put
[ui]
username =
into your mercurial.ini file. for future patches.
Hi Jorg, thanks. I don't know how it happened, but I already have the username
config in ~/.hgrc
, and it worked well for my other patches. Will take care next time.
Description
•