-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
fix: syntax error being thrown in Firefox for anonymous objects with computed property names #241
fix: syntax error being thrown in Firefox for anonymous objects with computed property names #241
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Compliance Checks
Thank you for your Pull Request! We have run several checks on this pull request in order to make sure it's suitable for merging into this project. The results are listed in the following section.
Issue Reference
In order to be considered for merging, the pull request description must refer to a specific issue number. This is described in our Contributing Guide.
This check is looking for a phrase similar to: "Fixes #XYZ" or "Resolves #XYZ" where XYZ is the issue number that this PR is meant to address.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congrats on making your first Pull Request and thanks for taking the time to improve Open Sauced! ❤️! 🎉🍕
Say hello by joining the conversation in our Discord
…computed property names
3e38e34
to
d633615
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you this contribution.
I submitted these updates to firefox. I am still working through how to test this and uploading a local version as well. |
There's not much to test in regards to Firefox. The login will still fail (no nothing). This is just one of a few errors I've encountered so far. You won't be able to test it locally at the moment in Firefox as there is a branch I have to get Firefox working which includes manifest file changes. The best bet is to just ensure it still works fine in Chromium based browsers, i.e. the login |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a branch I have to get Firefox working which includes manifest file changes.
I'm assuming these are manifest changes for things like background
which firefox doesn't seem to support the type
property. When I've tried to load the extension's manifest locally, I get:
There was an error during the temporary add-on installation.
Error details
Extension is invalid
Reading manifest: Error processing background: Value must either: contain the required "page" property, contain the required "scripts" property, or not contain an unexpected "type" property
which seems that firefox doesn't support the service worker background: https://stackoverflow.com/questions/73440104/failing-to-export-to-background-js-from-a-common-script-under-firefox-with-mv3
Regardless, this looks good to me!!
Yeah, like I said, this is one small fix. I'll have my Firefox branch for a while as there's other stuff I need to sort out still, and the manifest I have will need to be copied pre-build for Firefox etc. when it comes to the automated deployment. |
Ah, I see you mentioned that in the original issue: #237 (comment) 😅 this looks great! Thanks for all the legwork on this so far! |
I plan on streaming tomorrow and can take a closer look at this then. At the very least I am learning a lot more about Firefox. |
I'll push my branch later tonight where I'm experimenting if you want to take a peek at that. I'll tag it in #237 |
|
## [1.14.1-beta.1](v1.14.0...v1.14.1-beta.1) (2023-08-15) ### 🐛 Bug Fixes * syntax error being thrown in Firefox for anonymous objects with computed property names ([#241](#241)) ([00ba2c8](00ba2c8))
🎉 This PR is included in version 1.14.1-beta.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
## [1.14.1](v1.14.0...v1.14.1) (2023-11-01) ### ✅ Tests * setup playwright for e2e testing ([#262](#262)) ([fc9acca](fc9acca)) ### 🔁 Continuous Integration * bun install, x ([#265](#265)) ([6c765e0](6c765e0)) ### 🐛 Bug Fixes * linkedin projects share ([#264](#264)) ([481472b](481472b)) * login to the website after rename ([1070a0c](1070a0c)) * prevent error when viewing repo and not logged in ([#260](#260)) ([05fcf5e](05fcf5e)) * syntax error being thrown in Firefox for anonymous objects with computed property names ([#241](#241)) ([00ba2c8](00ba2c8))
🎉 This PR is included in version 1.14.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Description
The extension does not currently work in Firefox. This PR does not fix that, but addresses one of the errors that occurs when trying to get the extension to work in Firefox.
Firefox supports objects with computed property names, which allows using a variable as the key, for instance:
{ [OPEN_SAUCED_OPTED_LOG_OUT_KEY]: false }
In Firefox, this syntax requires it to be assigned to a variable, otherwise, it throws an error.
The fix involves assigning the object with the computed property name to a variable, like this:
Then it can be used in the code, like this:
To test this fix, ensure that things still behave correctly when the browser extension is running in a Chromium based browser (Chrome, Microsoft Edge, Arc Browser etc.)
What type of PR is this? (check all applicable)
Related Tickets & Documents
Relates to #237
Mobile & Desktop Screenshots/Recordings
Added tests?
Added to documentation?
[optional] Are there any post-deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?