bengarrett/RetroTxt

[FEATURE] Browser tab Options

bengarrett opened this issue · 1 comments

Update the Options user interface to use a browser tab much like the browsers themselves use.

The Chrome and Edge popup dialogues that are idiomatic to web-extensions are too small for RetroTxt's use case. And Chromium doesn't look to be updating these anytime soon.

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Options_pages

Possible UI frameworks to apply.

Code changes.

manifest.json

# chromium
"options_ui" : {
  "page": "options.html",
  "open_in_tab":true
}
# firefox
"options_ui": {
  "page": "options.html",
  "browser_style": true
},

for js

chrome.tabs.create({
    url: chrome.runtime.getURL('/options.html')
})
function onOpened() {
  console.log(`Options page opened`);
}

function onError(error) {
  console.log(`Error: ${error}`);
}

var opening = browser.runtime.openOptionsPage();
opening.then(onOpened, onError);

Complete.