From f6f2a3c3e029e0ba8e8ee5accd1f9766fa0746f7 Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Fri, 23 Jan 2015 20:39:42 +0800 Subject: [PATCH] Update nsIWebBrowserPersist.saveURI to be compatible with Firefox >= 36.0 --- chrome/content/scrapbook/saver.js | 4 +++- modules/common.jsm | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/chrome/content/scrapbook/saver.js b/chrome/content/scrapbook/saver.js index bdc0a1bd..d7c94ecf 100644 --- a/chrome/content/scrapbook/saver.js +++ b/chrome/content/scrapbook/saver.js @@ -939,7 +939,9 @@ var sbContentSaver = { var WBP = Components.classes['@mozilla.org/embedding/browser/nsWebBrowserPersist;1'].createInstance(Components.interfaces.nsIWebBrowserPersist); WBP.persistFlags |= WBP.PERSIST_FLAGS_FROM_CACHE; WBP.persistFlags |= WBP.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION; - if ( sbCommonUtils._fxVer18 ) { + if ( sbCommonUtils._fxVer36 ) { + WBP.saveURI(aURL, null, this.refURLObj, null, null, null, targetFile, null); + } else if ( sbCommonUtils._fxVer18 ) { WBP.saveURI(aURL, null, this.refURLObj, null, null, targetFile, null); } else { WBP.saveURI(aURL, null, this.refURLObj, null, null, targetFile); diff --git a/modules/common.jsm b/modules/common.jsm index 4b0a7e7a..8f2d403a 100644 --- a/modules/common.jsm +++ b/modules/common.jsm @@ -90,6 +90,10 @@ var sbCommonUtils = { delete this._fxVer30; return this._fxVer30 = (this.checkFirefoxVersion("30.0") >=0); }, + get _fxVer36() { + delete this._fxVer36; + return this._fxVer36 = (this.checkFirefoxVersion("36.0") >=0); + }, checkFirefoxVersion : function(ver) { return this.checkVersion(this.FIREFOX_VERSION, ver);