Starting Firefox with a temporary profile
I have been starting Firefox with temporary throwaway profiles (for research and testing purposes), and wrote this to make it a little faster.
#!/usr/bin/env python3
from os import path from subprocess import run from sys import argv from tempfile import TemporaryDirectory
Script to run Firefox with a temporary profile.
Takes one optional argument, URL to open.
Reference
kb.mozillazine.org/Bypassing_the_Profile_Manager
try: url = argv [ 1 ] except IndexError: url = "about:blank"
with TemporaryDirectory () as tmp: print ( "Starting Firefox with profile %s " % tmp )
Write a preferences file to turn off the first run pages
with open ( path. join ( tmp, "prefs.js" ), "w" ) as fh: print ( ''' user_pref("startup.homepage_welcome_url", ""); user_pref("datareporting.policy.dataSubmissionPolicyBypassNotification", true); user_pref("browser.startup.homepage", "chrome://browser/content/blanktab.html"); user_pref("toolkit.telemetry.reportingpolicy.firstRun", false); user_pref("trailhead.firstrun.didSeeAboutWelcome", true); ''', file = fh )
Start Firefox using the fresh profile, with developer tools open
run ([ '/usr/bin/firefox', '--devtools', '-profile', tmp, url ])
Based on the article Bypassing the Profile Manager from MozillaZine. This is the “unlisted profile” feature.
And the temporary profile directory gets cleaned up when the script exits.
Bonus linksThe Python you learned isn’t the Python that exists today. by Reuven Lerner. Covers dataclasses, collections, and even gets into uv which I have not tried yet. (So far I’m getting by with whatever Python modules are packaged by the distribution.)What the World Should Learn from Australia’s Social Media Law by Ravi Iyer, Jonathan Haidt and Zach Rausch. (Have you ever seen a Big Tech big shot sending their kid to an expensive private school where they get extra social media time?)We Need Modern Car Equivalents To Those Old ‘Twin Cam’ Badges And Luckily I Have Some by Jason Torchinsky. Here’s a good idea: if you are stuck with a car that uses some kind of miserable subscription service so you can have access to things like heated seats or whatever, may as well let everyone know your pain, right? Put that shit right on the back of the car!US Companies Are Realizing That Chinese AI Models Are Way Cheaper, Ditch American Ones by Frank Landymore. Meanwhile, China Is Cracking Down on AI Companions Because Not Enough Babies Are Being Born by Maggie Harrison Dupré.Gen Z is pushing back against AI – a reminder to all of us that the future isn’t written by Siobhan Lyons. Speaking at the University of Central Florida, property developer Gloria Caulfield declared AI is the next Industrial Revolution. The humanities graduates, already burdened with debt and job insecurity, responded with a torrent of boos. Former Google CEO Eric Schmidt and Big Machine Records CEO Scott Borchetta were also booed as they sang the praises of AI at graduation ceremonies. Their bemused reactions reflect a growing generational divide when it comes to AI adoption.The Slop Doctrine by Alice E. Marwick. While Republicans and Democrats are growing suspicious of AI at roughly the same pace, right-wing politicians and influencers have embraced AI slop in a way that the left has not. Why?Meta glasses celebrity backlash: the fans hate them by David Gerard. Related:The Backlash Is So Strong That People With “Pervert Glasses” Are Afraid to Use Them in Public by Maggie Harrison Dupré. (ICYMI: Maggie Harrison Dupré author RSS feed on Futurism )