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

[WIP] Firefox extension support #9

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Conversation

j6k4m8
Copy link

@j6k4m8 j6k4m8 commented Sep 22, 2020

Resolves #6.

Importantly, this maintains backwards compatibility with the Chrome extension format and vendor APIs.

  • Resolve crossref API bugginess. (Fixed in commit bc70aef)
  • Test backwards compat. with chrome
  • Packaging API for each browser (Fixed in commit c455247)

@j6k4m8 j6k4m8 changed the title Firefox extension support [WIP] Firefox extension support Sep 22, 2020
@ethanbb
Copy link

ethanbb commented Sep 22, 2020

Hey, I use Firefox daily and I'd be interested in helping to test/fix this.

I'm also wondering if it could be forked into a Zotero extension as well because I know they use the Firefox extension format. Probably a lot would have to be changed, but at some point I'd like to try it out.

@j6k4m8
Copy link
Author

j6k4m8 commented Sep 23, 2020

@ethanbb that would be awesome! Do you happen to have Chrome installed as well (to make sure performance is identical)? I'm on MacOS 10.15, other OS's / versions would be great to include in our tests if you've got em!

@ethanbb
Copy link

ethanbb commented Sep 23, 2020

@j6k4m8 Yup, I have Chrome installed as well and I'm on Windows 10. I'll give this draft a try when I get the chance!

@ethanbb
Copy link

ethanbb commented Sep 23, 2020

OK, the extension works in Chrome although it's pretty slow. Do the API calls just take a long time, e.g. to crossref.org? I haven't tried the current version in Jeni's fork for comparison yet.

I was able to load it as a "temporary extension" in Firefox. I get the warning:

Reading manifest: Warning processing background.persistent: Event pages are not currently supported. This will run as a persistent background page.

...which is just about the Google Analytics script, so I'm guessing that's OK.

I see from the console that the content script is running on a Google Scholar search results page, but I don't see the gender info showing up on the page. I wanted to try to debug the script, but the content script doesn't seem to show up in the "Debugger" tab of the dev tools. Do you know how to get it to show up? I was stumped in Chrome as well, but then I found the "Content scripts" tab under "Sources" - don't see something like that in Firefox, though.

@j6k4m8
Copy link
Author

j6k4m8 commented Sep 23, 2020

Confirmed that the Reading manifest issue is (I think!) not a big deal; it also appears that the Google Analytics script still loads, but it runs as a background page rather than an Event. So in terms of functionality, this is exactly the same as Chrome.

I'm currently encountering the same issue you are; can you wait a few minutes with the page open and see if you get any console output in the regular Firefox JS console output? (It doesn't appear to have its own page like it does in Chrome.)

@ethanbb
Copy link

ethanbb commented Sep 23, 2020

Yes, I do get output in the JS console from the extension, but no output on the page. It looks like it's getting to printing the titles of the papers and the messages "Unable to match title" and "Correct title not first entry," but I'm not getting any messages about authors being found. So perhaps the requests to genderize.io are failing.

@j6k4m8
Copy link
Author

j6k4m8 commented Oct 2, 2020

Interesting. I'm seeing the same thing. Does that match what you see in Chrome? It looks like I'm getting the same outputs in the console in FF/Chrome, but not getting writes to the FF DOM.

@ethanbb
Copy link

ethanbb commented Oct 12, 2020

The "Both authors found" outputs are definitely missing for me in Firefox, as well as the DOM writes. Here are my console outputs on the same search for comparison:

Chrome:
image

Firefox:
image

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 equivalent extension for Firefox
2 participants