Поиск в Поддержке

Избегайте мошенников, выдающих себя за службу поддержки. Мы никогда не попросим вас позвонить, отправить текстовое сообщение или поделиться личной информацией. Сообщайте о подозрительной активности, используя функцию «Пожаловаться».

Learn More

Disable F11 original solution not working in latest version (115.0 64-bit)

  • 2 ответа
  • 0 имеют эту проблему
  • 56 просмотров
  • Последний ответ от SouthSlope

more options

The solution for the original Disable F11 (https://support.mozilla.org/en-US/questions/1255696) is no longer working. When the solution is executed from the Browser Console...

doc = Services.wm.getMostRecentWindow("navigator:browser").window.document; if(E=doc.getElementById('key_fullScreen')){E.removeAttribute('keycode');E.removeAttribute('command');}

The return is a reference to "HTLMDocument chrome://browser/content/browser.xhtml" which can be opened up and displays more information.

It used to just come back with something like "Undefined." and then it worked (F11 was disabled for the browser instance). Looks like it just started to not work with this latest version of 115.0 64-bit as this solution has been working for over a couple of years now.

Is there a way to enable this to work in the latest version?

The solution for the original Disable F11 (https://support.mozilla.org/en-US/questions/1255696) is no longer working. When the solution is executed from the Browser Console... doc = Services.wm.getMostRecentWindow("navigator:browser").window.document; if(E=doc.getElementById('key_fullScreen')){E.removeAttribute('keycode');E.removeAttribute('command');} The return is a reference to "HTLMDocument chrome://browser/content/browser.xhtml" which can be opened up and displays more information. It used to just come back with something like "Undefined." and then it worked (F11 was disabled for the browser instance). Looks like it just started to not work with this latest version of 115.0 64-bit as this solution has been working for over a couple of years now. Is there a way to enable this to work in the latest version?

Выбранное решение

There is key_enterFullScreen and there is also key_exitFullScreen that both use F11, so if you do not want F11 to exit Full Screen mode then you need to disable both.

doc = Services.wm.getMostRecentWindow("navigator:browser").window.document;
if(E=doc.getElementById('key_enterFullScreen')){E.removeAttribute('keycode');E.removeAttribute('command');}
if(E=doc.getElementById('key_exitFullScreen')){E.removeAttribute('keycode');E.removeAttribute('command');}

Прочитайте этот ответ в контексте 👍 1

Все ответы (2)

more options

Выбранное решение

There is key_enterFullScreen and there is also key_exitFullScreen that both use F11, so if you do not want F11 to exit Full Screen mode then you need to disable both.

doc = Services.wm.getMostRecentWindow("navigator:browser").window.document;
if(E=doc.getElementById('key_enterFullScreen')){E.removeAttribute('keycode');E.removeAttribute('command');}
if(E=doc.getElementById('key_exitFullScreen')){E.removeAttribute('keycode');E.removeAttribute('command');}

more options

Works like a charm! Many thanks!