Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Can't use firefox.cfg #1631

Open
9 tasks done
fulalas opened this issue Mar 6, 2025 · 0 comments
Open
9 tasks done

[Bug]: Can't use firefox.cfg #1631

fulalas opened this issue Mar 6, 2025 · 0 comments
Labels
bug Something isn't working P5 Developers do not respond, only patches are welcome unconfirmed Developer has not yet confirmed.

Comments

@fulalas
Copy link

fulalas commented Mar 6, 2025

Pre-Submission Checklist

  • I have checked the existing/closed issues to ensure this issue has not already been reported.
  • I am using the latest supported version of the browser.
  • I have tried disabling all browser extensions/add-ons to rule out interference from these.
  • I have tried clearing the browser cache and cookies.
  • I have checked with a new profile and the issue still occurs.
  • I have provided detailed step-by-step instructions on how to reproduce the issue.
  • I have included relevant screenshots or console outputs.
  • I have checked that this problem is not occurring in the latest version of Firefox ESR.
  • This issue is specific to this browser and does not occur in other browsers.

Bug Summary

In order to disable ctrl+shift+s and ctrl+shift+d shortcuts, in Firefox I've been using firefox.cfg file with this:

// start autoconfig.cfg with a comment line
try {
 function ConfigJS() { Services.obs.addObserver(this, 'chrome-document-global-created', false); }
 ConfigJS.prototype = {
  observe: function (aSubject) { aSubject.addEventListener('DOMContentLoaded', this, {once: true}); },
  handleEvent: function (aEvent) {
   let document = aEvent.originalTarget;
   let window = document.defaultView;
   let location = window.location;

   if (/^(chrome:(?!\/\/(global\/content\/commonDialog|browser\/content\/webext-panels)\.x?html)|about:(?!blank))/i.test(location.href)) {
    if (window._gBrowser) { //place your code here
      let attr, elm, key, mbo;
      let KEYS = ['key_closeWindow', 'key_screenshot', 'bookmarkAllTabsKb'];
      let ATTR = ['key','modifiers','command','oncommand'];
      for (key in KEYS){
       elm = window.document.getElementById(KEYS[key]);
       if (elm) for (attr in ATTR) if (ATTR[attr] in elm.attributes) elm.removeAttribute(ATTR[attr]);
      }
    }  // gBrowser
   }   // location
  }    // handleEvent
 };    // prototype
 if (!Services.appinfo.inSafeMode) { new ConfigJS(); }
} catch(e) {Cu.reportError(e);}

Then all I need is to create defaults/pref/autoconfig.js with this:

pref("general.config.filename", "firefox.cfg");
pref("general.config.obscure_value", 0);

And voila, the shortcuts (ctrl+shift+s and ctrl+shift+d) are disabled.

Now, in Floorp this doesn't work. I tried to rename firefox.cfg to floorp.cfg (also changing the reference in defaults/pref/autoconfig.js) but still no luck.

Reproduction Steps

  1. close Floorp
  2. create firefox.cfg file in the browser main folder (not the user profile!) with the content explained in the summary above
  3. create defaults/pref/autoconfig.js file in the browser main folder (not the user profile!) with the content explained in the summary above
  4. open Floorp
  5. the following shortcuts should be disabled but they are not: ctrl+shift+s and ctrl+shift+d

Expected Behavior

The following shortcuts should be disabled: ctrl+shift+s and ctrl+shift+d

Actual Behavior

The following shortcuts should be disabled but they are not: ctrl+shift+s and ctrl+shift+d

Screenshots

Doesn't apply

Browser Version

11.24.0

Operating System

PorteuX 1.9 x64 (Linux)

Additional Context

This is confirmed to be working in all Firefox 128.x ESR so far.

@fulalas fulalas added the bug Something isn't working label Mar 6, 2025
@github-actions github-actions bot added P5 Developers do not respond, only patches are welcome unconfirmed Developer has not yet confirmed. labels Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P5 Developers do not respond, only patches are welcome unconfirmed Developer has not yet confirmed.
Projects
None yet
Development

No branches or pull requests

1 participant