-
Notifications
You must be signed in to change notification settings - Fork 34
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
Manifest V3 + multiple feature requests #46
Conversation
manifests/manifest.FIREFOX.json
Outdated
}, | ||
"browser_specific_settings": { | ||
"gecko": { | ||
"id": "{6bc19aa2-7d91-4791-b5d4-8d84b5f3cdad}", |
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.
I'm not exactly sure what this UUID actually means, but setting a unique one like this does allow the build to pass 🤔
return { url: "", title: "" }; | ||
} | ||
|
||
return tab; |
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.
This is so I can access more properties on the tab (like id
)
title: title || titlePlaceholder, | ||
description: description || descriptionPlaceholder, |
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.
I think this may be a bug in the current extension, but in any case this change also works as expected.
Dude, you're a legend! Thanks so much for this PR, it adds so many feature requests I've been following in one fell swoop 🚀 |
@bsecker Glad to hear it! If you're interested in testing the changes but don't want to pull and build locally, let me know and I can upload builds for Chrome and Firefox. Any QA would be appreciated. 🙇🏼 |
@gantoine I'll happily test it. A build for Firefox would be awesome! |
Awesome, and thank you! Here are the builds and instructions, which I've also added to the body of the PR.
|
Hey, thanks for the effort here, but this PR contains way too many changes for me to properly review it. Could you please extract individual features into separate PRs? Likewise for refactorings / manifest + build changes / etc. Some quick notes:
|
Yes absolutely! Since some of the work builds onto itself, I'll start by opening a PR just for the manifest changes that covers permissions.
I took a "something-is-better-then-nothing" approach to dark mode that could be done quickly. I'd love to see a more robust dark mode at some point, but until then I'll open a split PR for dark mode. |
My understanding is that the dot appears for websites where explicit permission isn't granted in the manifest. I see it as well, and I believe is has to do with the "tabs" permission. If you reload a page where the dot was removed after clicking it, it comes back.
https://support.mozilla.org/en-US/kb/extensions-button
This makes me think it's interacting with the old linkding extension (I assume) you had installed in Firefox. Could you try installing Firefox Developer Edition and testing it there, as it allows for installing unsigned add-ons (instead of having to load it temporarily)? @bsecker Thanks for taking the time to test it! |
Soooooo what started as a small change to replace
permissions: ["http://*/*", "https://*/*"]
quickly devolved into an evening-long refactor and enhancement of the extension. 🙃QA
If you're interested in testing these changes but don't want to pull and build locally, you can use these builds:
chrome://extensions/
about:debugging#/runtime/this-firefox
Manifest V3
With the switch to manifest V3, the spec for Chrome and Firefox splits; those differences need to be taken into consideration when building a
manifest.json
. Therefore, this PR takes the approach of splitting the manifest into 3 files:manifest.COMMON.json
,manifest.FIREFOX.json
andmanifest.CHROME.json
. During the build process, the COMMON file and one the browser files are merged usingjq
, and the output is saved asmanifest.json
(which is no longer tracked in git).background
is now split as Chrome now uses a service worker to run the background scriptbrowser_action
toaction
default_title
browser_style
set tofalse
since now deprecatedbrowser_specific_settings.id
required for Firefox (set to random UUIDv4)storage
: localStorage is deprecated in extension contextscontextMenus + notifications
: quick add link via right-clickscripting + activeTab
: get highlighted text for notesAnd one more thing: the build script now outputs both packaged and unpackaged builds to
/artifacts/chrome
and/artifacts/firefox
.Major Changes
Granular permissions
By marking
["http://*/*", "https://*/*"]
asoptional_host_permissions
, we can request only the permission(s) we need to connect to the Linkding instance. When first configuring the extension, you'll be prompted to grant permission to the page that hosts Linkding.Dark mode
The extension popup and settings will appear in dark mode, based on the appearance/theme settings of your browser/OS, via the prefers-color-scheme media feature. I may get around to adding a small toggle in the settings to allow for manual control. Closes #41
Context menu entry
Right-clicking on a link will give you the option to quick-add it to your bookmarks, without having to visit the page. A notification is displayed if it's been added, or if it was already bookmarked. Closes #35
Starred pinned badge
On bookmarked pages, a yellow star will appear on the badge (bottom-right on Chrome, top-right on Firefox). The star should appear as soon as a page is bookmarked, or when a new tab is opened. Closes #30
Other smaller changes
Commonjs
plugin in favour ofESM
As always, thoughts, questions and concerns are welcome!
Bonus screenshots