The-CodingSloth / haha-funny-leetcode-extension

MIT License
396 stars 75 forks source link

Support for other browsers #6

Open The-CodingSloth opened 11 months ago

The-CodingSloth commented 11 months ago

Currently the extension only supports chrome. Would be nice if we could support FireFox and Edge.

TheNewsYorkTime commented 10 months ago

I might work on this, I use firefox, what file structure would you want? Maybe another branch? Separate folders for the browser specific js?

The-CodingSloth commented 10 months ago

I think it might be easier for now to separate them into folders so a chrome folder and a Firefox folder would work. Since the extension code itself isn't too crazy We could also move the web-scraper into it's own area if needed since it's more of a utility.

TheNewsYorkTime commented 10 months ago

That seems best. I think I'll start working on the weekend. I might show my ignorance here, but I think firefox and chrome use the same manifest format?

Side note, I was thinking about the web scraper. It probably should be run every once in a while to pick up updates to the website. I wonder if it would be better to do it in the extension or run it before each release and supply the updated json when the extension updates. I'm leaning more towards the second option because I don't want to degrade the user experience. I don't know how much of a performance toll the scraper takes.

The-CodingSloth commented 10 months ago

Yup chrome and Firefox use the same manifest format. Your web scraper idea sounds good, maybe could add a new script in the package.json to scrape and then build. Might be good to have backup json files for the problems just in case something goes bad.

TheNewsYorkTime commented 10 months ago

So I just realized that the manifest would need to point to the correct script files for each browser, but just now I had another idea on how to fix that. Have a command to build for each browser, and move the files around so there can be just one manifest that points to the final destination of the scripts for each build type. I don't know how vite works, so you'd probably have to do that.

The-CodingSloth commented 10 months ago

hmm alright, if you do work on the firefox version and push it, I'll work on the build steps with vite to get it working, there's no issues if you make a temporary manifest file in the firefox folder to develop.

The-CodingSloth commented 10 months ago

Reopening this because while this framework can support other browsers, it's not supporting Firefox, a lot of the functionality is not working, so either 2 choices would have to be made:

  1. Revert back to no framework (manually setup different browsers)
  2. Get it working with this framework
davecarrijo commented 10 months ago

Just passing here to say good luck, I'm waiting for it.