Skip to content

Instantly share code, notes, and snippets.

@simonmicro
Created December 2, 2022 14:08
Show Gist options
  • Select an option

  • Save simonmicro/8ab3aae53de98e51798425c40f788eee to your computer and use it in GitHub Desktop.

Select an option

Save simonmicro/8ab3aae53de98e51798425c40f788eee to your computer and use it in GitHub Desktop.
Disable Firefox Pocket on Linux
#!/usr/bin/env python
import os
script = '''user_pref("extensions.pocket.enabled", false);
user_pref("extensions.pocket.api", "0.0.0.0");
user_pref("extensions.pocket.loggedOutVariant", "");
user_pref("extensions.pocket.oAuthConsumerKey", "");
user_pref("extensions.pocket.onSaveRecs", false);
user_pref("extensions.pocket.onSaveRecs.locales", "");
user_pref("extensions.pocket.showHome", false);
user_pref("extensions.pocket.site", "0.0.0.0");
user_pref("browser.newtabpage.activity-stream.pocketCta", "");
user_pref("browser.newtabpage.activity-stream.section.highlights.includePocket", false);
user_pref("browser.newtabpage.activity-stream.feeds.section.topstories", false);
// Set to false if you use sync
user_pref("services.sync.prefs.sync.browser.newtabpage.activity-stream.section.highlights.includePocket", false);
user_pref("services.sync.prefs.sync-seen.services.sync.prefs.sync.browser.newtabpage.activity-stream.section.highlights.includePocket", false);
user_pref("services.sync.prefs.sync.browser.newtabpage.activity-stream.feeds.section.topstories", false);
'''
basePath = os.path.expanduser('~/.mozilla/firefox/')
# Create user.js file containing the disable pocket code
with open(os.path.join(basePath, 'disable_pocket_user.js'), 'w') as f:
f.write(script)
print(f'Created disable_pocket_user.js in {basePath}')
for item in os.listdir(basePath):
if 'default-release' in item:
if os.path.exists(os.path.join(basePath, item, 'user.js')):
os.remove(os.path.join(basePath, item, 'user.js'))
os.symlink(os.path.join(basePath, 'disable_pocket_user.js'), os.path.join(basePath, item, 'user.js'))
print(f'Disabled Pocket for profile: {item}')
print('Restart Firefox to apply changes!')
@simonmicro
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment