Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 3 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | "use strict"; |
michael@0 | 6 | |
michael@0 | 7 | let Cu = Components.utils; |
michael@0 | 8 | let Ci = Components.interfaces; |
michael@0 | 9 | |
michael@0 | 10 | Cu.import("resource://gre/modules/XPCOMUtils.jsm"); |
michael@0 | 11 | Cu.import("resource://gre/modules/Services.jsm"); |
michael@0 | 12 | Cu.import("resource://gre/modules/PageThumbs.jsm"); |
michael@0 | 13 | Cu.import("resource://gre/modules/BackgroundPageThumbs.jsm"); |
michael@0 | 14 | Cu.import("resource://gre/modules/DirectoryLinksProvider.jsm"); |
michael@0 | 15 | Cu.import("resource://gre/modules/NewTabUtils.jsm"); |
michael@0 | 16 | Cu.import("resource://gre/modules/Promise.jsm"); |
michael@0 | 17 | |
michael@0 | 18 | XPCOMUtils.defineLazyModuleGetter(this, "Rect", |
michael@0 | 19 | "resource://gre/modules/Geometry.jsm"); |
michael@0 | 20 | XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", |
michael@0 | 21 | "resource://gre/modules/PrivateBrowsingUtils.jsm"); |
michael@0 | 22 | XPCOMUtils.defineLazyModuleGetter(this, "UpdateChannel", |
michael@0 | 23 | "resource://gre/modules/UpdateChannel.jsm"); |
michael@0 | 24 | |
michael@0 | 25 | let { |
michael@0 | 26 | links: gLinks, |
michael@0 | 27 | allPages: gAllPages, |
michael@0 | 28 | linkChecker: gLinkChecker, |
michael@0 | 29 | pinnedLinks: gPinnedLinks, |
michael@0 | 30 | blockedLinks: gBlockedLinks, |
michael@0 | 31 | gridPrefs: gGridPrefs |
michael@0 | 32 | } = NewTabUtils; |
michael@0 | 33 | |
michael@0 | 34 | XPCOMUtils.defineLazyGetter(this, "gStringBundle", function() { |
michael@0 | 35 | return Services.strings. |
michael@0 | 36 | createBundle("chrome://browser/locale/newTab.properties"); |
michael@0 | 37 | }); |
michael@0 | 38 | |
michael@0 | 39 | function newTabString(name) gStringBundle.GetStringFromName('newtab.' + name); |
michael@0 | 40 | |
michael@0 | 41 | function inPrivateBrowsingMode() { |
michael@0 | 42 | return PrivateBrowsingUtils.isWindowPrivate(window); |
michael@0 | 43 | } |
michael@0 | 44 | |
michael@0 | 45 | const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; |
michael@0 | 46 | const XUL_NAMESPACE = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; |
michael@0 | 47 | |
michael@0 | 48 | #include transformations.js |
michael@0 | 49 | #include page.js |
michael@0 | 50 | #include grid.js |
michael@0 | 51 | #include cells.js |
michael@0 | 52 | #include sites.js |
michael@0 | 53 | #include drag.js |
michael@0 | 54 | #include dragDataHelper.js |
michael@0 | 55 | #include drop.js |
michael@0 | 56 | #include dropTargetShim.js |
michael@0 | 57 | #include dropPreview.js |
michael@0 | 58 | #include updater.js |
michael@0 | 59 | #include undo.js |
michael@0 | 60 | #include search.js |
michael@0 | 61 | |
michael@0 | 62 | // Everything is loaded. Initialize the New Tab Page. |
michael@0 | 63 | gPage.init(); |