psidex / CustomBangSearch

A browser extension to use custom DuckDuckGo-like bangs directly from the address bar.
https://addons.mozilla.org/en-US/firefox/addon/custombangsearch/
GNU General Public License v3.0
58 stars 13 forks source link

Mobile permissions do not apply #38

Open domportera opened 1 year ago

domportera commented 1 year ago

Hi, i'm loving the extension so far and your commitment to synchronized storage. I'd love to use it on FF mobile but currently the permissions cannot be applied and so it cannot be used. Pressing "Enable Required Permissions" does not work, nor do any of its required permissions show up in the Add-Ons Manager

psidex commented 1 year ago

Hi! Thanks for the bug report, I'll see if I can load it onto my phone and get any logs from it. I will say that I never intended for it to be used on mobile so haven't done any sort of testing on that front.

domportera commented 1 year ago

thanks! i highly recommend it, it's a very nice feature for home screen/launcher search bar widgets :)

dktharrop commented 1 year ago

I looked in to it because I wanted to see if I could contribute and fix the bug. Unfortunately this happens because, as far as I can tell, the Firefox app has poor support for add-ons, and nobody on the Mozilla team seems to be doing anything about it (multiple issues opened for about 2+ years now). The main issue is that Firefox for mobile does not support Permissions.request which is used in this add-on to request the host_permissions. The only way to make it work on mobile is to make the host_permissions forced on install, which is not possible in manifest v3.

I have made a (very scuffed) fork of the project for now mostly for my own use, that back-ports the extension to manifest v2 and forces the host permissions. I did upload it to AMO, as the only way to install extensions on mobile is to use its collections feature. Feel free to use it as a temporary solution until Mozilla improves add-on support on mobile.

domportera commented 1 year ago

thanks so much!! thats a damn shame it had to be such an awkward task but id like to give it a shot if you're down to share the link

dktharrop commented 1 year ago

Use collections feature to add to Firefox Nightly

domportera commented 1 year ago

great! I will try that shortly. For synchronization purposes - have you tried to get this to work with the desktop browser too? or does what you had to do make that impossible?

dktharrop commented 1 year ago

Ill make it listed as compatible with desktop, but I'm not sure if it will work. I've been using the import/export feature which works fine so far.

domportera commented 1 year ago

thanks so much, it works! doesnt seem to actually sync but that's ok, i think that's a firefox limitation

psidex commented 1 year ago

Thanks for looking into it and setting that up @dktharrop! Is it just changes to the manifest file to get it to work? If so, it should be relatively straightforward to add a mobile build to the build script and therefore have an "official" mobile version for Firefox that stays up-to-date.

I'm not sure about the syncing issue, yeah could just be Firefox mobile being bad. I had actually planned to have some sort of custom backend storage for bangs (instead of the browsers sync storage) so that size limits could be improved. I'm not saying that that's in the works or even coming in the future but that could solve the sync issue across different versions, would work cross browser as well.

domportera commented 1 year ago

that sounds great but probably unnecessary. at some point in the (distant) future mozilla is bound to update mobile for sync support (or drop mobile extensions altogether), and increase extension storage limits, so in any event it doesnt need to be your problem ¯_(ツ)_/¯ id sooner think the more useful thing might be runtime scraping/download/jsonification to develop a local non-synced cache with synced user-specified overrides could solve all the above problems without touching the current file size limits

psidex commented 1 year ago

id sooner think the more useful thing might be runtime scraping/download/jsonification to develop a local non-synced cache with synced user-specified overrides could solve all the above problems without touching the current file size limits

Could you explain this a little more? I'm not sure what exactly you mean

domportera commented 1 year ago

Sorry I can see how that wasn't clear - let me know if this is moreso.

DDG's bangs are available on the web pretty much at all times - either in JSON format on github, or they can be scraped from DDG's website

Considering this, when the extension is installed, it can download those bangs from whatever source and save it in local non-synced storage. In reality, these don't have to be visible to the user in the settings menu at all, or configurable in any way. Then, the only options that need to be populated and synced by the extension are mere overrides of the official DDG bangs

psidex commented 1 year ago

Ah yeah that's clear!

I think that's a good idea, I'm definetly planning on supporting local storage for normal bangs in the future, but I hadn't considered having all the DDG ones saved locally and doing the overwrite thing.

domportera commented 1 year ago

idk if it aligns with your vision for the app, but it seems like a solve to me. there could be a master toggle for enabling/disabling all DDG bangs, or if you wanna get really crazy a toggle for each DDG bang as well. The latter would probably be overkill, but I imagine storing even all of that in the cloud should be trivially easy compared to the current amount of data stored.

i know it's a big undertaking and potentially super low-priority, if i had JS/TS experience i'd lend a hand 😅 just spitballing here

psidex commented 1 year ago

Some good news on the firefox mobile front, it looks like we might be seeing better support for desktop->mobile extensions coming soon - https://blog.mozilla.org/addons/2023/08/10/prepare-your-firefox-desktop-extension-for-the-upcoming-android-release/