• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

nuchi/firefox-quantum-userchromejs: **Stops working with FF v72.** Firefox Quant ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

nuchi/firefox-quantum-userchromejs

开源软件地址:

https://github.com/nuchi/firefox-quantum-userchromejs

开源编程语言:

JavaScript 55.5%

开源软件介绍:

Note: The trick contained in this repo stops working as of Firefox 72

It's very possible that at some future time the Firefox team will remove some or all of the functionality that makes this possible, so enjoy it while you can.

Now that the Firefox team has removed XBL from Firefox starting with version 72, this trick no longer works. It was a good run while it lasted!

See the Bugzilla tracking page Disable MOZ_XBL in Firefox.

Firefox Quantum compatible userChrome.js

What does this do?

Extensions that allow you to run arbitrary javascript in your browser context don't work anymore with Firefox 57 and later. This is a workaround which allows you to run arbitrary javascript in your browser context, as used to be enabled by the extension userChromeJS.

It does not involve adding any extensions, and instead works only by adding (or changing) files in your Firefox user profile.

After I made this I learned of something called autoconfig.js which apparently serves a similar purpose; I haven't investigated it very much.

Installation

Place the three userChrome.* files in a /chrome directory inside your Firefox profile. If you already have a userChrome.css file, you may instead add the contents of the file here anywhere in your existing file.

Replace the contents of userChrome.js with whatever you wish; it will execute in the browser context whenever you open a new browser window. The existing contents of that script (in this repo) are a small change to the fullscreen behavior of Firefox under macOS: it restores the pre-Lion behavior (and hides the toolbar and tabs when in fullscreen mode).

To uninstall, remove the three files. If you have other content in the userChrome.css file you can remove just the part that you added during installation.

Why did I make it?

I wanted to enable pre-Lion osx fullscreen mode, and couldn't find an easy way to do it in Firefox Quantum. It's possible with unpacking, altering, and repacking files in the Firefox.app package... but that's painful and might not survive updates. Then I came upon this method, realized this trick was far more general than just altering fullscreen mode, and factored it out so that the javascript part was easily modifiable by anyone.

How does it work?

It relies on the fact that post-57 Firefox still allows a custom userChrome.css file, and a Firefox-specific CSS hack which can bind javascript to arbitrary DOM elements. I picked (somewhat at random) a DOM element in the browser whose existing XBL binding didn't already have a <constructor> tag, and added some JS there to load an external javascript file.

It's very possible that at some future time the Firefox team will remove some or all of the functionality that makes this possible, so enjoy it while you can.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
wtetsu/mouse-dictionary: 发布时间:2022-05-13
下一篇:
chrisdaish/docker-firefox: Unofficial build of Mozilla Firefox running within a ...发布时间:2022-05-13
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap