-
Notifications
You must be signed in to change notification settings - Fork 21
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
Firefox for Android Tweaks #26
Conversation
Related to#3 Basically, I've confirmed that none of the pieces of functionality we use are currently available in Firefox for Android 118a01 (Nightly). I did, however, make it so that we show the extension popup more nicely, and a different message so there's no visual indication the extension doesn't work. - The search engine option doesn't show up, as the manifest indicator isn't recognized. - The incognito session doesn't work, as we can't inject the token into the request headers - The summarizer doesn't work since we'd need access to the active tab. When requesting the permission, the error that comes up is the same as mentioned in https://stackoverflow.com/questions/49051084/firefox-console-error-webextension-context-not-found which seems to still be unresolved in https://bugzilla.mozilla.org/show_bug.cgi?id=1447806 Given https://blog.mozilla.org/addons/2023/08/10/prepare-your-firefox-desktop-extension-for-the-upcoming-android-release/ I'd expect we can revisit this in a couple of months and hopefully have some more of the extension working, but for now, it just looks better. I also made some tweaks for Firefox (desktop) and Chrome, as I was testing everything, for UI consistency.
@@ -154,7 +154,7 @@ browser.runtime.onMessage.addListener(async (data) => { | |||
} | |||
}); | |||
|
|||
browser.commands.onCommand.addListener(async (command) => { | |||
browser.commands?.onCommand.addListener(async (command) => { |
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.
browser.commands
doesn't exist on Firefox for Android.
@@ -2,6 +2,7 @@ | |||
<html lang="en"> | |||
<head> | |||
<meta charset="utf-8"> | |||
<meta name="viewport" content="width=device-width, initial-scale=1"> |
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.
These make the popup not look incredibly tiny in Firefox for Android.
@@ -18,7 +19,7 @@ body { | |||
flex-direction: column; | |||
align-items: center; | |||
justify-content: center; | |||
width: 483px; | |||
width: 500px; |
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.
These changes make the popup look consistent throughout mobile, desktop, and Firefox + Chrome.
typeof browser.runtime.getBrowserInfo === 'function' && | ||
(await browser.runtime.getBrowserInfo()); | ||
|
||
// Note, _hoping_ by 119 this works, but there's no guarantee. |
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.
What happens if by 119 it still doesn't work, is that clicking the button won't do anything (like what happens for 0.3.6 right now).
parseInt(browserInfo.version, 10) <= 118 | ||
) { | ||
requestPermissionsButton.addEventListener('click', () => { | ||
alert('Cannot request activeTab permission on Android yet.'); |
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 the message you'll get on Firefox for Android.
Related to #3
Basically, I've confirmed that none of the pieces of functionality we use are currently available in Firefox for Android 118a01 (Nightly). I did, however, make it so that we show the extension popup more nicely, and a different message so there's no visual indication the extension doesn't work.
When requesting the permission, the error that comes up is the same as mentioned in https://stackoverflow.com/questions/49051084/firefox-console-error-webextension-context-not-found which seems to still be unresolved in https://bugzilla.mozilla.org/show_bug.cgi?id=1447806
Given https://blog.mozilla.org/addons/2023/08/10/prepare-your-firefox-desktop-extension-for-the-upcoming-android-release/ I'd expect we can revisit this in a couple of months and hopefully have some more of the extension working, but for now, it just looks better.
I also made some tweaks for Firefox (desktop) and Chrome, as I was testing everything, for UI consistency.
kagi_chrome_0.3.7.zip
kagi_firefox_0.3.7.zip
Note this last screenshot isn't "final" (I changed the message later, forgot to take another screenshot).