I had a custom new tab page working in Firefox on Arch Linux before I had to reformat due to various reasons and wanted to start new since I was changing my workflow from minimal no DE, no display manager, bspwm to Plasma 5 and SDDM etc.

My custom start page used to work for both new window and new tab, but I must have missed writing down a step because on this try, it’s only working for new tab and not new window.

Original post was on Reddit, but since the sub went private, I can’t access it.

  • jwr1@kbin.social
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    1 year ago

    I know I’m late, but here’s the original post:

    I was able to do this without an extension in Firefox. I followed the instructions here.

    These are the steps I took:

    1. Open the Firefox installation folder. For me, this was “C:\Program Files\Mozilla Firefox”

    2. Under this folder, open the “defaults\pref” folder. If not present, make those two folders.

    3. Create a file called “autoconfig.js” inside the “defaults\prefs” folder, and put the following in it. This lets us run our own Javascript to configure the browser. The comment line at the top is required.
      //
      pref("general.config.filename", "autoconfig.cfg");
      pref("general.config.obscure_value", 0);
      pref("general.config.sandbox_enabled", false);

    4. Go back to the Firefox program folder ..\..

    5. Create a file named “autoconfig.cfg”

    6. Put the following in the file, replacing the value of newTabURL with the path to your startpage. This is 5 lines.
      // first line is a comment
      var {classes:Cc,interfaces:Ci,utils:Cu} = Components;
      var newTabURL = "file:///PATH_TO_YOUR_START_PAGE.html";
      aboutNewTabService = Cc["@mozilla.org/browser/aboutnewtab-service;1"].getService(Ci.nsIAboutNewTabService);
      aboutNewTabService.newTabURL = newTabURL;

    7. Profit.

    • wasym@kbin.social
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      i tried this but everytime i restart the browser it says “Failed to read the configuration file. Please contact your system administrator.”
      any clue whats causing this?

      • smoof@kbin.socialOP
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        1 year ago

        So I guess I did copy the updated version. It works on new tab, but not new window though. I guess I remembered wrong that it worked on new window, too.

        New autoconfig.cfg:

        // This comment is required.
        var {classes:Cc,interfaces:Ci,utils:Cu} = Components;
        
        /* set new tab page */
        try {
          Cu.import("resource:///modules/AboutNewTab.jsm");
          var newTabURL = "file:///home/***/.startpage/index.html";
          AboutNewTab.newTabURL = newTabURL;
        } catch(e){Cu.reportError(e);} // report errors in the Browser Console
        
        

        I’m on Arch Linux, so the folder for the files are in /usr/lib/firefox/autoconfig.cfg and /usr/lib/firefox/defaults/pref/autoconfig.js.