Open Saghen opened 1 year ago
Wow, awesome work. I'm a bit daunted by such a massive overhaul PR, but a few initial thoughts:
media
submodule, it's there for a reason (to keep all assets in one place and avoid having img blobs in several repos).ua-parser-js
deprecation/removal impact browser detection? (looks okay, but not sure)This PR will probably supersede #81 #89 #100 (and more?)
Will the ua-parser-js deprecation/removal impact browser detection?
Tested on Firefox, Chrome and Opera but haven't tested on Safari
What's the "{{chrome/firefox}}.manifest..." magic?
Docs can be found here: https://vite-plugin-web-extension.aklinker1.io/guide/configuration.html#browser-specific-manifest-fields
To what extend have you tested it? :)
Tested the consent and popup on both Chrome and Firefox. Using it in a test environment alongside the production extension to see if there's any discrepancies
Heads up that I haven't abandoned this! It's been working great on my machine so far but would definitely like to get a few more eyes on it when it's closer to being ready. Waiting on the axios support for fetch https://github.com/axios/axios/pull/5146 or will look to test and get my changes in https://github.com/Saghen/aw-client-js merged in before this PR can be merged.
No worries!
Just a heads-up though, there have been a few changes to master since you made this PR. You might want to carefully rebase, or resolve them some other way.
I would also appreciate it if you avoided any change to formatting rules. Big PRs like this are difficult to review as it is, so let's keep the formatting changes as minimal as possible so that the diff is readable.
I merged the aw-client-js PR.
Curious if you'll continue to work on this, but no pressure or rush :)
Yep! Still planning to get this wrapped up
Surprised by some of my choices on the original PR, like removing the Makefile :stuck_out_tongue: Rebased onto master but none of the changes, beside the README change seemed to be applicable. Other changes:
I should have waited for your review before squashing the commits, sorry about that. Firefox supports Manifest v3 now so it may be worth upgrading to that in a subsequent PR, although there's some weird caveats wrt permissions that I might have to check on.
Hey @ErikBjare would you be willing to take over this PR? Seems like some pretty minor things at this point and you should have edit access to the branch. I feel that would be quicker than the back and forth
@Saghen I haven't reviewed it properly because the diff is practically unreadable due to the formatting changes, making git not understand that files were moved and edited, not deleted and rewritten from scratch. It is possible one might be able to fix this by using rebase and adding a move commit before the other commits (as explained here), but I haven't done that before.
Given this, I don't think I could take it over in its current state without a lot of work. I would instead probably recreate the PR from scratch with inspiration taken from this, which I don't think would be faster, and which I would probably continue to procrastinate. Let's see if the above thing works first, I'll give it a shot.
Edit: Will take a little work, but this works:
#!/usr/bin/fish
git rebase -i $branch_head^ # edit first commit
git reset HEAD^
# For each moved file
set old static/popup.js && git restore $old
set new src/popup/main.ts && mv $new $new.new && git mv $old $new && mv $new.new $new
git commit --amend
Gotcha, let me know how that goes! I did rewrite everything from scratch except for popup.html
and a couple others iirc so that's why git has not marked them as moved. And the formatting was to match the .editorconfig
that was already in the repo but I'll remove that and take care of the review comments soon
Gotcha, let me know how that goes!
It worked, but was too cumbersome to complete.
I did rewrite everything from scratch except for popup.html and a couple others iirc so that's why git has not marked them as moved.
I realized that as I made my attempt and actually saw how significant the changes were. Even harder to review 😅, but I massively appreciate the effort of putting this together! 🥇
I'll give it another pass when the CI is passing and the formatting stuff is fixed. Might try to get another pair of eyes on this.
@BelKed Yes, we'd have to check Brave detection and other recent commits to master (like https://github.com/ActivityWatch/aw-watcher-web/commit/0b289c4208f308050979fc729a69cf0c57dd7d8f) so that they're included correctly (as they may have disappeared in a rebase).
@ErikBjare comments resolved and rebased on master!
Really excited about this, will try to find time to review and merge in the coming days.
I am unable to load the result of make build-firefox
(firefox.zip) in firefox - It says This add-on could not be installed because it appears to be corrupt.
. For chrome, loading chrome.zip works fine.
https://stackoverflow.com/q/39854127
In the browserconsole (ctrl+J) I see:
addons.xpi WARN Invalid XPI: Error: Cannot find id for addon
I was able to load the aw-watcher-web.zip
from current master just fine.
Ok, it's probably due to missing:
"browser_specific_settings": {
"gecko": {
"id": "{<uuid>}"
}
},
in manifest.json
I recently discovered this fantastic project and, while getting the extension running on Firefox, I noticed the extension could use a fresh coat of paint. In general, I've attempted to improve the maintainability of the codebase through refactoring and the switch to Typescript while attempting to avoid complexity from a bundler.
browser.storage.local
intostorage.ts
Currently, I'm using a fork of
aw-client-js
with support forfetch
. Axios uses XHR behind the scenes which has been removed in Service Workers, a requirement for Manifest V3. Fetch is only supported on Node 18+ by default so I'll need to revisit those changes. https://github.com/Saghen/aw-client-js