redhat-developer / try-in-dev-spaces-browser-extension

MIT License
0 stars 4 forks source link

Add a dropdown item for going to the options page #28

Closed dkwon17 closed 1 year ago

dkwon17 commented 1 year ago

Fixes https://github.com/redhat-developer/try-in-dev-spaces-browser-extension/issues/22

This PR adds a dropdown item that brings the user to the options page:

image
Demo video: https://user-images.githubusercontent.com/83611742/219819240-0669fbdf-ff49-4e6a-b275-0a4c44e5bb27.mov

This PR also adds new scripts in package.json:

    "build:firefox-safari": "cross-env TARGET=firefox-safari webpack --mode=development",
    "watch:firefox-safari": "yarn build:firefox-safari --watch",

used to build/watch the extension for use with Firefox/Safari.

This is because there are small differences in how things are defined in the V3 manifest. For our case:

  1. The background script is declared differently
  2. The browser_specific_settings field causes a warning on Chromium based browsers. (This field is necessary for Firefox to use storage.sync api)

To test this PR:

On Google chrome,

  1. Run yarn && yarn build and sideload the extension
  2. Click on the 'Configure' dropdown item in the dropdown
  3. The options page should open

To test the new commands in this PR:

  1. Run yarn build and confirm that the extension is built in dist/chromium
  2. Run yarn build:firefox-safari and confirm that the extension is built in dist/firefox-safari
  3. Sideload each extension on Google Chrome / Firefox / Safari