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

feat: Firefox Support #33

Merged
merged 2 commits into from
Feb 20, 2021
Merged

feat: Firefox Support #33

merged 2 commits into from
Feb 20, 2021

Conversation

janpio
Copy link
Contributor

@janpio janpio commented Sep 3, 2019

This makes a few tiny changes which makes this extension compatible to Firefox and will enable it to be uploaded to the Firefox Addon Store at https://addons.mozilla.org/ via https://addons.mozilla.org/en-US/developers/

When this PR is merged, you should be able to just zip the content of /src and upload the resulting file as an addon via https://addons.mozilla.org/en-US/developers/

closes #27

@janpio
Copy link
Contributor Author

janpio commented Sep 3, 2019

When this PR is merged, you should be able to just zip the content of /src and upload the resulting file as an addon via addons.mozilla.org/en-US/developers

When testing this, I unfortunately got a warning during the upload process:

image

Not super sure what this means - should not really influence a submission though.


The sprint.min.js file will also lead to problems with a different policy:
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Source_Code_Submission
As this is third party code, this will apply:
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Third_Party_Library_Usage

You must provide a link to the source code for any third-party libraries included in your extension, minified or not.

Fortunately it is pretty simple to find the sprint.min.js that is used in the extension:
https://github.com/bendc/sprint/blob/master/sprint.min.js
And the unobfuscated version:
https://github.com/bendc/sprint/blob/master/sprint.js

As they need a canonical link, this would be:
https://github.com/bendc/sprint/blob/a220796dc6470cc928726a3f15192ca5389af36c/sprint.min.js
https://github.com/bendc/sprint/blob/a220796dc6470cc928726a3f15192ca5389af36c/sprint.js

And for github-injection.js:
https://github.com/OctoLinker/injection/blob/v0.2.0/index.js

For query-string.js I unfortunately could not find a source, it mentions @sindresorhus's query-string but I could match the version being used here to the code I see, probably the wzrd.in service that was used here changed some things 🤷‍

Providing these links in the "Notes to Reviewers" should be enough for the review to pass from my experience:

Hi reviewer!

Some "Third Party Library Usage" information:

- `src/vendor/sprint.min.js` is: https://github.com/bendc/sprint/blob/a220796dc6470cc928726a3f15192ca5389af36c/sprint.min.js
https://github.com/bendc/sprint/blob/a220796dc6470cc928726a3f15192ca5389af36c/sprint.js
unminified version is here: https://github.com/bendc/sprint/blob/a220796dc6470cc928726a3f15192ca5389af36c/sprint.js

- `src/vendor/github-injection.js` is https://github.com/OctoLinker/injection/blob/v0.2.0/index.js

- `src/vendor/query-string.js` is a copied together version of an old, unknown release of https://github.com/sindresorhus/query-string (plus some wzrd.in stuff). Should be simple enough to understand.

Thanks.

@janpio
Copy link
Contributor Author

janpio commented Sep 3, 2019

For the "Use OAuth" button to work, the URL https://a5214dd0dba2954f758dc5038d74737e71ba6e6a.extensions.allizom.org/provider_cb needs to be added as a valid redirect_uri for the GitHub app client_id = "1a3ac4d44a9e65a75a77" (see more context for this at #27 (comment))

And that's it, with this information this should be fully usable as a Firefox Addon 🚀 🐰 💕

@janpio janpio marked this pull request as ready for review September 3, 2019 19:33
@janpio janpio changed the title Firefox Support feat: Firefox Support Sep 3, 2019
@kuceb
Copy link

kuceb commented Nov 6, 2019

hi @janpio , I believe you may only have one redirect url set per Github Oauth app. You would need a trusted proxy to forward them to the right place, which is a bummer. I think that's why you see many other github extensions use only the personal token approach

Edit: as an alternative, you could host a github pages site from this repo that acts as the proxy.

@janpio
Copy link
Contributor Author

janpio commented Nov 10, 2019

Thanks @bkucera, interesting information. That indeed sounds like a usable workaround for the limitation you also mentioned. Unfortunately currently the extension is broken because of other reasons: #34

Copy link
Owner

@hzoo hzoo left a comment

Choose a reason for hiding this comment

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

Thanks (a lot!!!) 🙌 for your investigations and work, apologies having not looked into this in a long while. After #36 figured I'd look at everything again. Also started using firefox somewhat more so this is great!

submitted to the store (looks like you might have tried it before? and a few people in the queue, but hopefully it gets approved soon)

@hzoo hzoo merged commit bcbf701 into hzoo:master Feb 20, 2021
@hzoo
Copy link
Owner

hzoo commented Feb 21, 2021

@janpio looks like it's working! https://addons.mozilla.org/en-US/firefox/addon/contributor-on-github

but yeah didn't try the oauth part either @bkucera, maybe yeah we can do the pages thing or just note that it's' only for chrome atm

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.

firefox support
3 participants