[Pkg-javascript-commits] [pdf.js] 181/204: [Firefox] Use getTabForBrowser instead of _getTabForBrowser if possible
David Prévot
taffit at moszumanska.debian.org
Sat Oct 25 18:50:49 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit a34e7aa8fe94fe4f7d62ab2aebe3db1075579b97
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date: Fri Oct 10 22:26:52 2014 +0200
[Firefox] Use getTabForBrowser instead of _getTabForBrowser if possible
---
extensions/firefox/content/PdfStreamConverter.jsm | 13 ++++++++++++-
extensions/firefox/content/PdfjsChromeUtils.jsm | 13 ++++++++++++-
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/extensions/firefox/content/PdfStreamConverter.jsm b/extensions/firefox/content/PdfStreamConverter.jsm
index 4dd26a4..ee53761 100644
--- a/extensions/firefox/content/PdfStreamConverter.jsm
+++ b/extensions/firefox/content/PdfStreamConverter.jsm
@@ -77,7 +77,18 @@ function getFindBar(domWindow) {
var browser = getContainingBrowser(domWindow);
try {
var tabbrowser = browser.getTabBrowser();
- var tab = tabbrowser._getTabForBrowser(browser);
+ var tab;
+//#if MOZCENTRAL
+ tab = tabbrowser.getTabForBrowser(browser);
+//#else
+ if (tabbrowser.getTabForBrowser) {
+ tab = tabbrowser.getTabForBrowser(browser);
+ } else {
+ // _getTabForBrowser is depreciated in Firefox 35, see
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=1039500.
+ tab = tabbrowser._getTabForBrowser(browser);
+ }
+//#endif
return tabbrowser.getFindBar(tab);
} catch (e) {
// FF22 has no _getTabForBrowser, and FF24 has no getFindBar
diff --git a/extensions/firefox/content/PdfjsChromeUtils.jsm b/extensions/firefox/content/PdfjsChromeUtils.jsm
index f24f4ab..b830f3d 100644
--- a/extensions/firefox/content/PdfjsChromeUtils.jsm
+++ b/extensions/firefox/content/PdfjsChromeUtils.jsm
@@ -272,7 +272,18 @@ let PdfjsChromeUtils = {
*/
function PdfjsFindbarWrapper(aBrowser) {
let tabbrowser = aBrowser.getTabBrowser();
- let tab = tabbrowser._getTabForBrowser(aBrowser);
+ let tab;
+//#if MOZCENTRAL
+ tab = tabbrowser.getTabForBrowser(aBrowser);
+//#else
+ if (tabbrowser.getTabForBrowser) {
+ tab = tabbrowser.getTabForBrowser(aBrowser);
+ } else {
+ // _getTabForBrowser is depreciated in Firefox 35, see
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=1039500.
+ tab = tabbrowser._getTabForBrowser(aBrowser);
+ }
+//#endif
this._findbar = tabbrowser.getFindBar(tab);
};
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git
More information about the Pkg-javascript-commits
mailing list