Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make extension icon open a tab on click #41

Merged
merged 29 commits into from
Aug 6, 2021

Conversation

blueputty01
Copy link
Contributor

@blueputty01 blueputty01 commented Jul 20, 2021

Closes #17.

Changes proposed in this PR:

  • added icon action handlers
  • added action and browser_action properties to respective Jest API mocks
  • added icon actions to Jest tests

added event handler for icon click to open new tab
must have action key for icon click event handler to work
originally console.log, now console.error
two unit tests for same function
removed redundant new line
added browser_action property
removed test for redundant url
@kmjennison
Copy link
Contributor

Thanks for this contribution! Just a heads up, I'm OOO and won't get around to reviewing this for a week or two.

Copy link
Contributor

@kmjennison kmjennison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks great! Just a few small changes.

@@ -14,7 +14,8 @@
"background": {
"service_worker": "ext-background.js"
},
"action": {},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test to each test-manifest.js to simply verify this value. It would be helpful to comment in the test that an empty object activates the browser action icon so is different from an undefined action value.

@@ -56,14 +56,19 @@ test('sets the post-uninstall URL', () => {
.toHaveBeenCalledWith('https://tab.gladly.io/newtab/uninstalled/')
})

test('gracefully handles errors with setting the post-uninstall URL', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you accidentally replaced an existing test. Please re-add that test.

src/setupTests.js Show resolved Hide resolved
add post-uninstall url error handling
Manifest V2 uses browserAction key; V3 uses action key
browser_action property must exist for icon to be shown in toolbar
Copy link
Contributor

@kmjennison kmjennison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the contribution, @blue-putty!

@kmjennison kmjennison changed the title Issue 17 Make extension icon open a tab on click Aug 6, 2021
@kmjennison kmjennison merged commit 569f4d2 into gladly-team:master Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make extension icon action open a new tab page
2 participants