为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

nsBrowserContentHandler.js is gibberish

  • 4 个回答
  • 1 人有此问题
  • 1 次查看
  • 最后回复者为 Yaron

more options

I'd like to modify some lines in nsBrowserContentHandler.js.

I've extracted omni.ja. JS files in "omni\jsloader\resource\app\components" are gibberish (using Notepad++). I have no problem opening JS files in omni\chrome\browser\content\browser.

Any idea?

Thank you.

I'd like to modify some lines in nsBrowserContentHandler.js. I've extracted omni.ja. JS files in "omni\jsloader\resource\app\components" are gibberish (using Notepad++). I have no problem opening JS files in omni\chrome\browser\content\browser. Any idea? Thank you.

所有回复 (4)

more options

It is likely that the files in jsloader are compressed and can't be viewed directly.

Did you try to access the file via the components folder?

Maybe create an extension to overlay this function with a modified version.

  • resource:///components/nsBrowserContentHandler.js

Note that it isn't recommended to make changes to files in an omni.ja archive.

more options

Thank you cor-el. You're brilliant.

I've opened nsBrowserContentHandler.js in "omni\components".

I want to allow external links to open in a private window. I've changed the following lines:

 var allowPrivate = forcePrivate || PrivateBrowsingUtils.permanentPrivateBrowsing;
 var navWin = RecentWindow.getMostRecentBrowserWindow({private: allowPrivate});

to:

// var allowPrivate = forcePrivate || PrivateBrowsingUtils.permanentPrivateBrowsing;

 var navWin = RecentWindow.getMostRecentBrowserWindow({private: true});

After zipping the files and replacing omni.ja, I don't get what I want. I guess I have to modify the file in "omni\jsloader\resource\app\components" as well. How do I do that?

more options

Do you see the modified file with the resource:// link?

  • resource:///components/nsBrowserContentHandler.js
more options

Yes, I do see it.

Thanks again.