Closed INSANEMODE closed 6 months ago
Instead of being an option, can you make it prompt for permission on any twitter page load if it doesn't have permissions? I feel like this option will be non-discoverable. This will also make it more obvious for Firefox users that additional permissions are required.
Sure, I'll take a look at it after I get off work.
If you do not want the changes to the setup flow, it can be reverted or changed easily.
On Firefox for android, permissions.request
was only added in version 120, so if gecko_android gets added to your manifest in the future to support android(probably after figuring out context menu alternatives and reports window scrolling), that should probably be your strict_min_version.
Also, permissions.request
can only be called through a user input handler, so it can't just directly prompt a user from a background script. That is the reason i added it to the start page.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/permissions/request
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/User_actions
Thanks, it looks good! I'll test it when I'm at my desk and merge in when I can.
I made the process a bit more streamlined, would you like to give it a go and make sure it still works on all the platforms you're targeting?
Sure, I'll be home soon, and I can test it within the hour.
Clean up looks good, and looks to be working correctly on chrome desktop, firefox desktop, and firefox for android.
The check for the twitter Oauth tab to prevent opening the permissions tab works.
Denying the permissions on firefox shows that you denied them, and asks you to grant them again.
Revoking the permissions after the setup screen causes you to be asked to grant the permissions again when visiting twitter.com /x.com
add setting to general options page to allow mobile users to grant host permissions, since firefox for android does not currently allow users to grant/deny permissions
example code this feature is based on can be found here: https://github.com/Rob--W/fosdem-2024-ext/blob/main/code-samples/content_scripts.mv3%2Boptions_ui/options.js
On Firefox for android, permissions cannot be granted or denied by the user through the settings, including host permissions. Due to this limitation, content scripts cannot load without clicking the extension icon, every time you refresh the page or go to another tab.
This option will request the host permissions from the extension itself, allowing the user to allow/deny host permissions. The option is redundant on desktop browsers, so it could potentially be hidden if it isn't relevant to the platform.
On Chromium browsers, this permission can't be revoked after granting it, through the extension.
I do not know if this is a problem on mobile browsers like kiwi, because i couldn't get the extensions page to load properly on my device, or my emulator, with the current version available on the play store.
Video of problem, and feature in use: https://www.youtube.com/watch?v=HW7CY-SXvnI