搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

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.