Closed allo- closed 7 years ago
This would be useful for testing.
I'm not sure the best way to do this. Chrome doesn't have global extension preferences like firefox does, so you can't set a preference before installation to turn off the first run page. And I don't think firefox preferences api is exposed to WebExtensions.
@allo- how are you installing Privacy Badger?
My usecase is preinstalling it in new profiles, which means i place it in the extension folder with the right name (as the installed extension has, not as the download from addons.mozilla.org has) and add in the new prefs.js user_pref("extensions.autoDisableScopes", 14);
. The the extensions gets installed on first run and should be updated as soon as possible.
yea unfortunately I'm not sure there is any way to do this any more with the new web extensions API. Maybe you could add in a pre-configured storage.json that already has the first run page setting toggled and all of the other pre-seeded settings that would desire?
So the new api doesn't use about:config anymore at all? I think i need to look into the new SDK what it is doing and what would be possible to configure before installation.
I guess it's ./browser-extension-data/jid1-MnnxcxisBPnSXQ@jetpack/storage.js
and then json['seenComic']=true
now? I think this should be no problem, if the setting is parsed every time (i.e. even in a trigger right after installation).
yes that is it! I believe that setting is parsed every time, so that should do the trick. Good luck!
@allo- that should work except that name "jid1-MnnxcxisBPnSXQ@jetpack
" might be unique for each user and if it is related to the extension URL. Unlike chrome, where the extension URL is based off the app developers' public key, so it is the same for each user.
This code might be useful: https://github.com/EFForg/privacybadger/pull/1168/files#diff-f448424892a6d1a088de9a3cc2c800abR28
But that might be practical for you, since most users will not have marionette installed.
@allo- Ah, that string actually comes from package.json
(here). So it is deterministic and should be easy to get.
seenComic seems not to be set, if you closed the tab, but the comic is not shown again. There is a isFirstRun
setting, which seems to be set.
In theory this should work:
extensions/jid1-MnnxcxisBPnSXQ@jetpack.xpi
user_pref("extensions.autoDisableScopes", 14);
to prefs.js (else the addon is added as disabled)browser-extension-data/jid1-MnnxcxisBPnSXQ@jetpack/storage.js
with content {"settings_map":{"isFirstRun": false}}
currently this does not work. I am still experimenting, if the installation of the addon overwrites the storage.js file or if am still missing something. Possibly extensions.json or another file needs to be pregenerated as well.
@cooperq The user does not need to have installed anything, but should get a pregenerated profile in a zipfile. But the generator should work without advanced stuff like selenium, too. I do not want to run it, the profile.zip should be a bare minimum (people can control what's in there) and everyone should be able to setup the site himself without too much efford.
were you not able to get storage.js working then?
I tried yesterday the steps described above without success. I need to test more before i know if i did something in the wrong order or if its not working and depends on other "is already installed" config options in the profile.
So my current status: I will work on it again, when i have enough time and patience.
Single Quotes are invalid JSON.
It works, with: {"settings_map":{"isFirstRun": false}}
.
I corrected my post above, so you can use it if you want to build tests based on it.
You can create a test profile on ffprofile.com. Go directly to the "addons" section and select only "privacy badger". Then save and download profile.zip
on the finish page.
This seems related to #914.
Can you merge/adapt https://github.com/EFForg/privacybadgerfirefox-legacy/commit/1eca2cbe8472792dbf68278daf7261c4682710b9 for the new addon?