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

Firefox for Android Tweaks #26

Merged
merged 1 commit into from
Aug 18, 2023
Merged

Conversation

BrunoBernardino
Copy link
Contributor

@BrunoBernardino BrunoBernardino commented Aug 18, 2023

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.


kagi_chrome_0.3.7.zip

kagi_firefox_0.3.7.zip


Screenshot_20230818-110013

Screenshot_20230818-110020

Screenshot_20230818-110028

Note this last screenshot isn't "final" (I changed the message later, forgot to take another screenshot).

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.
@BrunoBernardino BrunoBernardino self-assigned this Aug 18, 2023
@@ -154,7 +154,7 @@ browser.runtime.onMessage.addListener(async (data) => {
}
});

browser.commands.onCommand.addListener(async (command) => {
browser.commands?.onCommand.addListener(async (command) => {
Copy link
Contributor Author

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">
Copy link
Contributor Author

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;
Copy link
Contributor Author

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.
Copy link
Contributor Author

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.');
Copy link
Contributor Author

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.

@vprelovac vprelovac merged commit 766d244 into main Aug 18, 2023
1 check passed
@BrunoBernardino BrunoBernardino deleted the feature/firefox-android-tweaks branch August 18, 2023 15:30
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.

2 participants