зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-c to autoland, a=merge
This commit is contained in:
Коммит
609b9922f7
1
.gdbinit
1
.gdbinit
|
@ -16,6 +16,7 @@ handle SIGPIPE noprint nostop pass
|
|||
# sandboxing code on older kernels.
|
||||
handle SIG38 noprint nostop pass
|
||||
handle SIG64 noprint nostop pass
|
||||
handle SIGSYS noprint nostop pass
|
||||
|
||||
# Show the concrete types behind nsIFoo
|
||||
set print object on
|
||||
|
|
|
@ -51,10 +51,6 @@ public:
|
|||
// node, only the umbrella event on the ancestor will be emitted.
|
||||
eCoalesceReorder,
|
||||
|
||||
// eCoalesceMutationTextChange : coalesce text change events caused by
|
||||
// tree mutations of the same tree level.
|
||||
eCoalesceMutationTextChange,
|
||||
|
||||
// eCoalesceOfSameType : For events of the same type, only the newest event
|
||||
// will be processed.
|
||||
eCoalesceOfSameType,
|
||||
|
@ -214,7 +210,7 @@ class AccMutationEvent: public AccEvent
|
|||
{
|
||||
public:
|
||||
AccMutationEvent(uint32_t aEventType, Accessible* aTarget) :
|
||||
AccEvent(aEventType, aTarget, eAutoDetect, eCoalesceMutationTextChange)
|
||||
AccEvent(aEventType, aTarget, eAutoDetect, eCoalesceReorder)
|
||||
{
|
||||
// Don't coalesce these since they are coalesced by reorder event. Coalesce
|
||||
// contained text change events.
|
||||
|
|
|
@ -90,11 +90,15 @@ EventQueue::CoalesceEvents()
|
|||
|
||||
switch(tailEvent->mEventRule) {
|
||||
case AccEvent::eCoalesceReorder:
|
||||
MOZ_ASSERT(tailEvent->mAccessible->IsApplication() ||
|
||||
tailEvent->mAccessible->IsOuterDoc() ||
|
||||
tailEvent->mAccessible->IsXULTree(),
|
||||
{
|
||||
DebugOnly<Accessible*> target = tailEvent->mAccessible.get();
|
||||
MOZ_ASSERT(target->IsApplication() ||
|
||||
target->IsOuterDoc() ||
|
||||
target->IsXULTree(),
|
||||
"Only app or outerdoc accessible reorder events are in the queue");
|
||||
MOZ_ASSERT(tailEvent->GetEventType() == nsIAccessibleEvent::EVENT_REORDER, "only reorder events should be queued");
|
||||
break; // case eCoalesceReorder
|
||||
}
|
||||
|
||||
case AccEvent::eCoalesceOfSameType:
|
||||
{
|
||||
|
|
|
@ -2273,8 +2273,15 @@ DocAccessible::UncacheChildrenInSubtree(Accessible* aRoot)
|
|||
RemoveDependentIDsFor(aRoot);
|
||||
|
||||
uint32_t count = aRoot->ContentChildCount();
|
||||
for (uint32_t idx = 0; idx < count; idx++)
|
||||
UncacheChildrenInSubtree(aRoot->ContentChildAt(idx));
|
||||
for (uint32_t idx = 0; idx < count; idx++) {
|
||||
Accessible* child = aRoot->ContentChildAt(idx);
|
||||
|
||||
// Removing this accessible from the document doesn't mean anything about
|
||||
// accessibles for subdocuments, so skip removing those from the tree.
|
||||
if (!child->IsDoc()) {
|
||||
UncacheChildrenInSubtree(child);
|
||||
}
|
||||
}
|
||||
|
||||
if (aRoot->IsNodeMapEntry() &&
|
||||
mNodeToAccessibleMap.Get(aRoot->GetNode()) == aRoot)
|
||||
|
|
|
@ -351,8 +351,11 @@ HTMLTextFieldAccessible::Value(nsString& aValue)
|
|||
}
|
||||
|
||||
HTMLInputElement* input = HTMLInputElement::FromContent(mContent);
|
||||
if (input)
|
||||
input->GetValue(aValue);
|
||||
if (input) {
|
||||
// Pass NonSystem as the caller type, to be safe. We don't expect to have a
|
||||
// file input here.
|
||||
input->GetValue(aValue, CallerType::NonSystem);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -552,7 +555,10 @@ HTMLSpinnerAccessible::Value(nsString& aValue)
|
|||
if (!aValue.IsEmpty())
|
||||
return;
|
||||
|
||||
HTMLInputElement::FromContent(mContent)->GetValue(aValue);
|
||||
// Pass NonSystem as the caller type, to be safe. We don't expect to have a
|
||||
// file input here.
|
||||
HTMLInputElement::FromContent(mContent)->GetValue(aValue,
|
||||
CallerType::NonSystem);
|
||||
}
|
||||
|
||||
double
|
||||
|
@ -628,7 +634,10 @@ HTMLRangeAccessible::Value(nsString& aValue)
|
|||
if (!aValue.IsEmpty())
|
||||
return;
|
||||
|
||||
HTMLInputElement::FromContent(mContent)->GetValue(aValue);
|
||||
// Pass NonSystem as the caller type, to be safe. We don't expect to have a
|
||||
// file input here.
|
||||
HTMLInputElement::FromContent(mContent)->GetValue(aValue,
|
||||
CallerType::NonSystem);
|
||||
}
|
||||
|
||||
double
|
||||
|
|
|
@ -342,9 +342,9 @@ this.AccessFu = { // jshint ignore:line
|
|||
case 'remote-browser-shown':
|
||||
case 'inprocess-browser-shown':
|
||||
{
|
||||
// Ignore notifications that aren't from a BrowserOrApp
|
||||
// Ignore notifications that aren't from a Browser
|
||||
let frameLoader = aSubject.QueryInterface(Ci.nsIFrameLoader);
|
||||
if (!frameLoader.ownerIsMozBrowserOrAppFrame) {
|
||||
if (!frameLoader.ownerIsMozBrowserFrame) {
|
||||
return;
|
||||
}
|
||||
this._handleMessageManager(frameLoader.messageManager);
|
||||
|
|
|
@ -536,7 +536,16 @@ function eventQueue(aEventType)
|
|||
}
|
||||
|
||||
// Check if handled event matches any expected async events.
|
||||
var haveUnmatchedAsync = false;
|
||||
for (idx = 0; idx < eventSeq.length; idx++) {
|
||||
if (eventSeq[idx] instanceof orderChecker && haveUnmatchedAsync) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!eventSeq[idx].wasCaught) {
|
||||
haveUnmatchedAsync = true;
|
||||
}
|
||||
|
||||
if (!eventSeq[idx].unexpected && eventSeq[idx].async) {
|
||||
if (eventQueue.compareEvents(eventSeq[idx], aEvent)) {
|
||||
this.processMatchedChecker(aEvent, eventSeq[idx], scnIdx, idx);
|
||||
|
@ -553,6 +562,16 @@ function eventQueue(aEventType)
|
|||
invoker.check(aEvent);
|
||||
}
|
||||
|
||||
for (idx = 0; idx < eventSeq.length; idx++) {
|
||||
if (!eventSeq[idx].wasCaught) {
|
||||
if (eventSeq[idx] instanceof orderChecker) {
|
||||
eventSeq[idx].wasCaught++;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we don't have more events to wait then schedule next invoker.
|
||||
if (this.hasMatchedScenario()) {
|
||||
if (this.mNextInvokerStatus == kInvokerNotScheduled) {
|
||||
|
@ -596,6 +615,7 @@ function eventQueue(aEventType)
|
|||
(aEventSeq[aEventSeq.idx].unexpected ||
|
||||
aEventSeq[aEventSeq.idx].todo ||
|
||||
aEventSeq[aEventSeq.idx].async ||
|
||||
aEventSeq[aEventSeq.idx] instanceof orderChecker ||
|
||||
aEventSeq[aEventSeq.idx].wasCaught > 0)) {
|
||||
aEventSeq.idx++;
|
||||
}
|
||||
|
@ -612,7 +632,7 @@ function eventQueue(aEventType)
|
|||
// sync expcected events yet.
|
||||
for (var idx = 0; idx < aEventSeq.length; idx++) {
|
||||
if (!aEventSeq[idx].unexpected && !aEventSeq[idx].todo &&
|
||||
!aEventSeq[idx].wasCaught)
|
||||
!aEventSeq[idx].wasCaught && !(aEventSeq[idx] instanceof orderChecker))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1679,6 +1699,15 @@ function invokerChecker(aEventType, aTargetOrFunc, aTargetFuncArg, aIsAsync)
|
|||
this.mTargetFuncArg = aTargetFuncArg;
|
||||
}
|
||||
|
||||
/**
|
||||
* event checker that forces preceeding async events to happen before this
|
||||
* checker.
|
||||
*/
|
||||
function orderChecker()
|
||||
{
|
||||
this.__proto__ = new invokerChecker(null, null, null, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic invoker checker for todo events.
|
||||
*/
|
||||
|
|
|
@ -613,9 +613,6 @@ pref("hal.processPriorityManager.gonk.MASTER.OomScoreAdjust", 0);
|
|||
pref("hal.processPriorityManager.gonk.MASTER.KillUnderKB", 4096);
|
||||
pref("hal.processPriorityManager.gonk.MASTER.cgroup", "");
|
||||
|
||||
pref("hal.processPriorityManager.gonk.PREALLOC.OomScoreAdjust", 67);
|
||||
pref("hal.processPriorityManager.gonk.PREALLOC.cgroup", "apps/bg_non_interactive");
|
||||
|
||||
pref("hal.processPriorityManager.gonk.FOREGROUND_HIGH.OomScoreAdjust", 67);
|
||||
pref("hal.processPriorityManager.gonk.FOREGROUND_HIGH.KillUnderKB", 5120);
|
||||
pref("hal.processPriorityManager.gonk.FOREGROUND_HIGH.cgroup", "apps/critical");
|
||||
|
@ -693,12 +690,6 @@ pref("gonk.notifySoftLowMemUnderKB", 43008);
|
|||
// blocked on a poll(), and this pref has no effect.)
|
||||
pref("gonk.systemMemoryPressureRecoveryPollMS", 5000);
|
||||
|
||||
// Enable pre-launching content processes for improved startup time
|
||||
// (hiding latency).
|
||||
pref("dom.ipc.processPrelaunch.enabled", true);
|
||||
// Wait this long before pre-launching a new subprocess.
|
||||
pref("dom.ipc.processPrelaunch.delayMs", 5000);
|
||||
|
||||
pref("dom.ipc.reuse_parent_app", false);
|
||||
|
||||
// When a process receives a system message, we hold a CPU wake lock on its
|
||||
|
|
|
@ -36,8 +36,6 @@ XPCOMUtils.defineLazyGetter(this, 'MemoryFront', function() {
|
|||
return devtools.require('devtools/server/actors/memory').MemoryFront;
|
||||
});
|
||||
|
||||
Cu.import('resource://gre/modules/Frames.jsm');
|
||||
|
||||
var _telemetryDebug = false;
|
||||
|
||||
function telemetryDebug(...args) {
|
||||
|
@ -54,7 +52,6 @@ function telemetryDebug(...args) {
|
|||
*/
|
||||
var developerHUD = {
|
||||
|
||||
_targets: new Map(),
|
||||
_histograms: new Set(),
|
||||
_customHistograms: new Set(),
|
||||
_client: null,
|
||||
|
@ -99,13 +96,6 @@ var developerHUD = {
|
|||
}
|
||||
}
|
||||
|
||||
Frames.addObserver(this);
|
||||
|
||||
let appFrames = Frames.list().filter(frame => frame.getAttribute('mozapp'));
|
||||
for (let frame of appFrames) {
|
||||
this.trackFrame(frame);
|
||||
}
|
||||
|
||||
SettingsListener.observe('hud.logging', this._logging, enabled => {
|
||||
this._logging = enabled;
|
||||
});
|
||||
|
@ -124,63 +114,10 @@ var developerHUD = {
|
|||
return;
|
||||
}
|
||||
|
||||
for (let frame of this._targets.keys()) {
|
||||
this.untrackFrame(frame);
|
||||
}
|
||||
|
||||
Frames.removeObserver(this);
|
||||
|
||||
this._client.close();
|
||||
delete this._client;
|
||||
},
|
||||
|
||||
/**
|
||||
* This method will ask all registered watchers to track and update metrics
|
||||
* on an app frame.
|
||||
*/
|
||||
trackFrame(frame) {
|
||||
if (this._targets.has(frame)) {
|
||||
return;
|
||||
}
|
||||
|
||||
DebuggerServer.connectToChild(this._conn, frame).then(actor => {
|
||||
let target = new Target(frame, actor);
|
||||
this._targets.set(frame, target);
|
||||
|
||||
for (let w of this._watchers) {
|
||||
w.trackTarget(target);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
untrackFrame(frame) {
|
||||
let target = this._targets.get(frame);
|
||||
if (target) {
|
||||
for (let w of this._watchers) {
|
||||
w.untrackTarget(target);
|
||||
}
|
||||
|
||||
target.destroy();
|
||||
this._targets.delete(frame);
|
||||
}
|
||||
},
|
||||
|
||||
onFrameCreated(frame, isFirstAppFrame) {
|
||||
let mozapp = frame.getAttribute('mozapp');
|
||||
if (!mozapp) {
|
||||
return;
|
||||
}
|
||||
this.trackFrame(frame);
|
||||
},
|
||||
|
||||
onFrameDestroyed(frame, isLastAppFrame) {
|
||||
let mozapp = frame.getAttribute('mozapp');
|
||||
if (!mozapp) {
|
||||
return;
|
||||
}
|
||||
this.untrackFrame(frame);
|
||||
},
|
||||
|
||||
log(message) {
|
||||
if (this._logging) {
|
||||
dump(DEVELOPER_HUD_LOG_PREFIX + ': ' + message + '\n');
|
||||
|
|
|
@ -358,7 +358,6 @@ var shell = {
|
|||
document.createElementNS('http://www.w3.org/1999/xhtml', 'html:iframe');
|
||||
systemAppFrame.setAttribute('id', 'systemapp');
|
||||
systemAppFrame.setAttribute('mozbrowser', 'true');
|
||||
systemAppFrame.setAttribute('mozapp', manifestURL);
|
||||
systemAppFrame.setAttribute('allowfullscreen', 'true');
|
||||
systemAppFrame.setAttribute('src', 'blank.html');
|
||||
let container = document.getElementById('container');
|
||||
|
|
|
@ -53,7 +53,6 @@ var remoteShell = {
|
|||
document.createElementNS("http://www.w3.org/1999/xhtml", "html:iframe");
|
||||
systemAppFrame.setAttribute("id", this.id);
|
||||
systemAppFrame.setAttribute("mozbrowser", "true");
|
||||
systemAppFrame.setAttribute("mozapp", manifestURL);
|
||||
systemAppFrame.setAttribute("allowfullscreen", "true");
|
||||
systemAppFrame.setAttribute("src", "blank.html");
|
||||
|
||||
|
|
|
@ -40,8 +40,6 @@ function debug(str) {
|
|||
|
||||
const kNotificationIconSize = 128;
|
||||
|
||||
const kDesktopNotificationPerm = "desktop-notification";
|
||||
|
||||
const kNotificationSystemMessageName = "notification";
|
||||
|
||||
const kDesktopNotification = "desktop-notification";
|
||||
|
@ -256,13 +254,6 @@ var AlertsHelper = {
|
|||
},
|
||||
|
||||
receiveMessage: function(aMessage) {
|
||||
if (!aMessage.target.assertAppHasPermission(kDesktopNotificationPerm)) {
|
||||
Cu.reportError("Desktop-notification message " + aMessage.name +
|
||||
" from a content process with no " + kDesktopNotificationPerm +
|
||||
" privileges.");
|
||||
return;
|
||||
}
|
||||
|
||||
switch(aMessage.name) {
|
||||
case kMessageAlertNotificationSend:
|
||||
this.showAlertNotification(aMessage);
|
||||
|
|
|
@ -30,10 +30,7 @@ function B2GTabList(connection) {
|
|||
B2GTabList.prototype = Object.create(BrowserTabList.prototype);
|
||||
|
||||
B2GTabList.prototype._getBrowsers = function() {
|
||||
return Frames.list().filter(frame => {
|
||||
// Ignore app frames
|
||||
return !frame.getAttribute("mozapp");
|
||||
});
|
||||
return Frames.list();
|
||||
};
|
||||
|
||||
B2GTabList.prototype._getSelectedBrowser = function() {
|
||||
|
@ -59,21 +56,11 @@ B2GTabList.prototype._listenForEventsIf = function(shouldListen) {
|
|||
};
|
||||
|
||||
B2GTabList.prototype.onFrameCreated = function(frame) {
|
||||
let mozapp = frame.getAttribute("mozapp");
|
||||
if (mozapp) {
|
||||
// Ignore app frames
|
||||
return;
|
||||
}
|
||||
this._notifyListChanged();
|
||||
this._checkListening();
|
||||
};
|
||||
|
||||
B2GTabList.prototype.onFrameDestroyed = function(frame) {
|
||||
let mozapp = frame.getAttribute("mozapp");
|
||||
if (mozapp) {
|
||||
// Ignore app frames
|
||||
return;
|
||||
}
|
||||
let actor = this._actorByBrowser.get(frame);
|
||||
if (actor) {
|
||||
this._handleActorClose(actor, frame);
|
||||
|
|
|
@ -176,8 +176,8 @@ var ErrorPage = {
|
|||
|
||||
observe: function errorPageObserve(aSubject, aTopic, aData) {
|
||||
let frameLoader = aSubject.QueryInterface(Ci.nsIFrameLoader);
|
||||
// Ignore notifications that aren't from a BrowserOrApp
|
||||
if (!frameLoader.ownerIsMozBrowserOrAppFrame) {
|
||||
// Ignore notifications that aren't from a Browser
|
||||
if (!frameLoader.ownerIsMozBrowserFrame) {
|
||||
return;
|
||||
}
|
||||
this._listenError(frameLoader);
|
||||
|
|
|
@ -19,9 +19,6 @@ const Observer = {
|
|||
// the FrameDestroyed event with a frame reference.
|
||||
_frames: new Map(),
|
||||
|
||||
// Also save current number of iframes opened by app
|
||||
_apps: new Map(),
|
||||
|
||||
start: function () {
|
||||
Services.obs.addObserver(this, 'remote-browser-shown', false);
|
||||
Services.obs.addObserver(this, 'inprocess-browser-shown', false);
|
||||
|
@ -30,10 +27,6 @@ const Observer = {
|
|||
SystemAppProxy.getFrames().forEach(frame => {
|
||||
let mm = frame.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader.messageManager;
|
||||
this._frames.set(mm, frame);
|
||||
let mozapp = frame.getAttribute('mozapp');
|
||||
if (mozapp) {
|
||||
this._apps.set(mozapp, (this._apps.get(mozapp) || 0) + 1);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -42,7 +35,6 @@ const Observer = {
|
|||
Services.obs.removeObserver(this, 'inprocess-browser-shown');
|
||||
Services.obs.removeObserver(this, 'message-manager-close');
|
||||
this._frames.clear();
|
||||
this._apps.clear();
|
||||
},
|
||||
|
||||
observe: function (subject, topic, data) {
|
||||
|
@ -70,17 +62,9 @@ const Observer = {
|
|||
onMessageManagerCreated: function (mm, frame) {
|
||||
this._frames.set(mm, frame);
|
||||
|
||||
let isFirstAppFrame = null;
|
||||
let mozapp = frame.getAttribute('mozapp');
|
||||
if (mozapp) {
|
||||
let count = (this._apps.get(mozapp) || 0) + 1;
|
||||
this._apps.set(mozapp, count);
|
||||
isFirstAppFrame = (count === 1);
|
||||
}
|
||||
|
||||
listeners.forEach(function (listener) {
|
||||
try {
|
||||
listener.onFrameCreated(frame, isFirstAppFrame);
|
||||
listener.onFrameCreated(frame);
|
||||
} catch(e) {
|
||||
dump('Exception while calling Frames.jsm listener:' + e + '\n' +
|
||||
e.stack + '\n');
|
||||
|
@ -97,17 +81,9 @@ const Observer = {
|
|||
|
||||
this._frames.delete(mm);
|
||||
|
||||
let isLastAppFrame = null;
|
||||
let mozapp = frame.getAttribute('mozapp');
|
||||
if (mozapp) {
|
||||
let count = (this._apps.get(mozapp) || 0) - 1;
|
||||
this._apps.set(mozapp, count);
|
||||
isLastAppFrame = (count === 0);
|
||||
}
|
||||
|
||||
listeners.forEach(function (listener) {
|
||||
try {
|
||||
listener.onFrameDestroyed(frame, isLastAppFrame);
|
||||
listener.onFrameDestroyed(frame);
|
||||
} catch(e) {
|
||||
dump('Exception while calling Frames.jsm listener:' + e + '\n' +
|
||||
e.stack + '\n');
|
||||
|
|
|
@ -76,7 +76,6 @@ this.SafeMode = {
|
|||
debug("Registry is ready, loading " + url);
|
||||
let frame = document.createElementNS("http://www.w3.org/1999/xhtml", "html:iframe");
|
||||
frame.setAttribute("mozbrowser", "true");
|
||||
frame.setAttribute("mozapp", shell.manifestURL);
|
||||
frame.setAttribute("id", "systemapp"); // To keep screen.js happy.
|
||||
let contentBrowser = document.body.appendChild(frame);
|
||||
|
||||
|
|
|
@ -331,8 +331,6 @@
|
|||
@RESPATH@/components/ConsoleAPIStorage.js
|
||||
@RESPATH@/components/BrowserElementParent.manifest
|
||||
@RESPATH@/components/BrowserElementParent.js
|
||||
@RESPATH@/components/BrowserElementProxy.manifest
|
||||
@RESPATH@/components/BrowserElementProxy.js
|
||||
@RESPATH@/components/PhoneNumberService.js
|
||||
@RESPATH@/components/PhoneNumberService.manifest
|
||||
@RESPATH@/components/NotificationStorage.js
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
user_pref("devtools.debugger.prompt-connection", false);
|
||||
user_pref("devtools.debugger.forbid-certified-apps", false);
|
||||
user_pref("devtools.apps.forbidden-permissions", "");
|
||||
user_pref("b2g.software-buttons", true);
|
||||
|
||||
// Required for Mulet in order to run the debugger server from the command line
|
||||
|
|
|
@ -10,6 +10,7 @@ module.exports = {
|
|||
"vars": "local",
|
||||
"varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS",
|
||||
"args": "none",
|
||||
}]
|
||||
}],
|
||||
"no-shadow": "error"
|
||||
}
|
||||
};
|
||||
|
|
|
@ -23,6 +23,15 @@ NSDISTMODE = copy
|
|||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
# If we are trying to show an error dialog about the lack of SSE2 support,
|
||||
# make sure that code itself doesn't use SSE2.
|
||||
ifdef MOZ_LINUX_32_SSE2_STARTUP_ERROR
|
||||
CXXFLAGS := $(filter-out -march=% -msse -msse2 -mfpmath=sse,$(CXXFLAGS))
|
||||
CXX := $(filter-out -march=% -msse -msse2 -mfpmath=sse,$(CXX))
|
||||
CXXFLAGS += -mno-sse -mno-sse2 -mfpmath=387
|
||||
CXX += -march=pentiumpro
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
# Rebuild firefox.exe if the manifest changes - it's included by splash.rc.
|
||||
# (this dependency should really be just for firefox.exe, not other targets)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<blocklist lastupdate="1479128827245" xmlns="http://www.mozilla.org/2006/addons-blocklist">
|
||||
<blocklist lastupdate="1479243909840" xmlns="http://www.mozilla.org/2006/addons-blocklist">
|
||||
<emItems>
|
||||
<emItem blockID="i988" id="{b12785f5-d8d0-4530-a3ea-5c4263b85bef}">
|
||||
<prefs/>
|
||||
|
@ -181,11 +181,11 @@
|
|||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="3"/>
|
||||
</emItem>
|
||||
<emItem blockID="i501" id="xivars@aol.com">
|
||||
<emItem blockID="i716" id="{cc6cc772-f121-49e0-b1f0-c26583cb0c5e}">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="3"/>
|
||||
</emItem>
|
||||
<emItem blockID="i716" id="{cc6cc772-f121-49e0-b1f0-c26583cb0c5e}">
|
||||
<emItem blockID="i501" id="xivars@aol.com">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="3"/>
|
||||
</emItem>
|
||||
|
@ -598,10 +598,6 @@
|
|||
</prefs>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="1"/>
|
||||
</emItem>
|
||||
<emItem blockID="i400" id="{dd6b651f-dfb9-4142-b0bd-09912ad22674}">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="1"/>
|
||||
</emItem>
|
||||
<emItem blockID="i1227" id="{A34CAF42-A3E3-11E5-945F-18C31D5D46B0}">
|
||||
<prefs>
|
||||
<pref>security.csp.enable</pref>
|
||||
|
@ -610,6 +606,10 @@
|
|||
</prefs>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="1"/>
|
||||
</emItem>
|
||||
<emItem blockID="i400" id="{dd6b651f-dfb9-4142-b0bd-09912ad22674}">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="1"/>
|
||||
</emItem>
|
||||
<emItem blockID="i11" id="yslow@yahoo-inc.com">
|
||||
<prefs/>
|
||||
<versionRange minVersion="2.0.5" maxVersion="2.0.5">
|
||||
|
@ -884,14 +884,14 @@
|
|||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="1"/>
|
||||
</emItem>
|
||||
<emItem blockID="i65" id="activity@facebook.com">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*"/>
|
||||
</emItem>
|
||||
<emItem blockID="i532" id="249911bc-d1bd-4d66-8c17-df533609e6d8@c76f3de9-939e-4922-b73c-5d7a3139375d.com">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="1"/>
|
||||
</emItem>
|
||||
<emItem blockID="i65" id="activity@facebook.com">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*"/>
|
||||
</emItem>
|
||||
<emItem blockID="i1264" id="suchpony@suchpony.de">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="1.6.7" severity="3"/>
|
||||
|
@ -1160,6 +1160,10 @@
|
|||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="3"/>
|
||||
</emItem>
|
||||
<emItem blockID="i515" id="/^({bf9194c2-b86d-4ebc-9b53-1c08b6ff779e}|{61a83e16-7198-49c6-8874-3e4e8faeb4f3}|{f0af464e-5167-45cf-9cf0-66b396d1918c}|{5d9968c3-101c-4944-ba71-72d77393322d}|{01e86e69-a2f8-48a0-b068-83869bdba3d0})$/">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="1"/>
|
||||
</emItem>
|
||||
<emItem blockID="i844" id="e9d197d59f2f45f382b1aa5c14d82@8706aaed9b904554b5cb7984e9.com">
|
||||
<prefs>
|
||||
<pref>browser.startup.homepage</pref>
|
||||
|
@ -1167,10 +1171,6 @@
|
|||
</prefs>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="1"/>
|
||||
</emItem>
|
||||
<emItem blockID="i515" id="/^({bf9194c2-b86d-4ebc-9b53-1c08b6ff779e}|{61a83e16-7198-49c6-8874-3e4e8faeb4f3}|{f0af464e-5167-45cf-9cf0-66b396d1918c}|{5d9968c3-101c-4944-ba71-72d77393322d}|{01e86e69-a2f8-48a0-b068-83869bdba3d0})$/">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="1"/>
|
||||
</emItem>
|
||||
<emItem blockID="i216" id="fdm_ffext@freedownloadmanager.org">
|
||||
<prefs/>
|
||||
<versionRange minVersion="1.0" maxVersion="1.3.1">
|
||||
|
@ -1231,10 +1231,6 @@
|
|||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="1"/>
|
||||
</emItem>
|
||||
<emItem blockID="i92" id="play5@vide04flash.com">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*"/>
|
||||
</emItem>
|
||||
<emItem blockID="i45" id="{22119944-ED35-4ab1-910B-E619EA06A115}">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0.1" maxVersion="7.9.20.6" severity="1">
|
||||
|
@ -1243,6 +1239,10 @@
|
|||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i92" id="play5@vide04flash.com">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*"/>
|
||||
</emItem>
|
||||
<emItem blockID="i220" id="pricepeep@getpricepeep.com">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="2.1.0.19.99" severity="1"/>
|
||||
|
@ -1592,14 +1592,14 @@
|
|||
<prefs/>
|
||||
<versionRange minVersion=" " severity="1"/>
|
||||
</emItem>
|
||||
<emItem blockID="i854" id="/^(7tG@zEb\.net|ru@gfK0J\.edu)$/">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="3"/>
|
||||
</emItem>
|
||||
<emItem blockID="i73" id="a1g0a9g219d@a1.com">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*"/>
|
||||
</emItem>
|
||||
<emItem blockID="i854" id="/^(7tG@zEb\.net|ru@gfK0J\.edu)$/">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="3"/>
|
||||
</emItem>
|
||||
<emItem blockID="i662" id="imbaty@taringamp3.com">
|
||||
<prefs/>
|
||||
<versionRange minVersion="0" maxVersion="*" severity="3"/>
|
||||
|
|
|
@ -86,6 +86,9 @@ if CONFIG['HAVE_CLOCK_MONOTONIC']:
|
|||
if CONFIG['MOZ_GPSD']:
|
||||
DEFINES['MOZ_GPSD'] = True
|
||||
|
||||
if CONFIG['MOZ_LINUX_32_SSE2_STARTUP_ERROR']:
|
||||
DEFINES['MOZ_LINUX_32_SSE2_STARTUP_ERROR'] = True
|
||||
|
||||
for icon in ('firefox', 'document', 'newwindow', 'newtab', 'pbmode'):
|
||||
DEFINES[icon.upper() + '_ICO'] = '"%s/dist/branding/%s.ico"' % (
|
||||
TOPOBJDIR, icon)
|
||||
|
|
|
@ -43,6 +43,52 @@
|
|||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/WindowsDllBlocklist.h"
|
||||
|
||||
#ifdef MOZ_LINUX_32_SSE2_STARTUP_ERROR
|
||||
#include <cpuid.h>
|
||||
#include "mozilla/Unused.h"
|
||||
|
||||
static bool
|
||||
IsSSE2Available()
|
||||
{
|
||||
// The rest of the app has been compiled to assume that SSE2 is present
|
||||
// unconditionally, so we can't use the normal copy of SSE.cpp here.
|
||||
// Since SSE.cpp caches the results and we need them only transiently,
|
||||
// instead of #including SSE.cpp here, let's just inline the specific check
|
||||
// that's needed.
|
||||
unsigned int level = 1u;
|
||||
unsigned int eax, ebx, ecx, edx;
|
||||
unsigned int bits = (1u<<26);
|
||||
unsigned int max = __get_cpuid_max(0, nullptr);
|
||||
if (level > max) {
|
||||
return false;
|
||||
}
|
||||
__cpuid_count(level, 0, eax, ebx, ecx, edx);
|
||||
return (edx & bits) == bits;
|
||||
}
|
||||
|
||||
static const char sSSE2Message[] =
|
||||
"This browser version requires a processor with the SSE2 instruction "
|
||||
"set extension.\nYou may be able to obtain a version that does not "
|
||||
"require SSE2 from your Linux distribution.\n";
|
||||
|
||||
__attribute__((constructor))
|
||||
static void
|
||||
SSE2Check()
|
||||
{
|
||||
if (IsSSE2Available()) {
|
||||
return;
|
||||
}
|
||||
// Using write() in order to avoid jemalloc-based buffering. Ignoring return
|
||||
// values, since there isn't much we could do on failure and there is no
|
||||
// point in trying to recover from errors.
|
||||
MOZ_UNUSED(write(STDERR_FILENO,
|
||||
sSSE2Message,
|
||||
MOZ_ARRAY_LENGTH(sSSE2Message) - 1));
|
||||
// _exit() instead of exit() to avoid running the usual "at exit" code.
|
||||
_exit(255);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(MOZ_WIDGET_COCOA) && !defined(MOZ_WIDGET_ANDROID) \
|
||||
&& !(defined(XP_LINUX) && defined(MOZ_SANDBOX))
|
||||
#define MOZ_BROWSER_CAN_BE_CONTENTPROC
|
||||
|
|
|
@ -436,8 +436,6 @@ pref("browser.tabs.showAudioPlayingIcon", true);
|
|||
// This should match Chromium's audio indicator delay.
|
||||
pref("browser.tabs.delayHidingAudioPlayingIconMS", 3000);
|
||||
|
||||
pref("browser.tabs.dontfocusfordialogs", true);
|
||||
|
||||
pref("browser.ctrlTab.previews", false);
|
||||
|
||||
// By default, do not export HTML at shutdown.
|
||||
|
|
|
@ -367,7 +367,7 @@ appUpdater.prototype =
|
|||
if (this.backgroundUpdateEnabled) {
|
||||
this.selectPanel("applying");
|
||||
let self = this;
|
||||
Services.obs.addObserver(function (aSubject, aTopic, aData) {
|
||||
Services.obs.addObserver(function(aSubject, aTopic, aData) {
|
||||
// Update the UI when the background updater is finished
|
||||
let status = aData;
|
||||
if (status == "applied" || status == "applied-service" ||
|
||||
|
|
|
@ -184,14 +184,14 @@
|
|||
document.getElementById("learnMoreContainer").style.display = "block";
|
||||
|
||||
var checkbox = document.getElementById("automaticallyReportInFuture");
|
||||
checkbox.addEventListener("change", function ({target: {checked}}) {
|
||||
checkbox.addEventListener("change", function({target: {checked}}) {
|
||||
document.dispatchEvent(new CustomEvent("AboutNetErrorSetAutomatic", {
|
||||
detail: checked,
|
||||
bubbles: true
|
||||
}));
|
||||
});
|
||||
|
||||
addEventListener("AboutNetErrorOptions", function (event) {
|
||||
addEventListener("AboutNetErrorOptions", function(event) {
|
||||
var options = JSON.parse(event.detail);
|
||||
if (options && options.enabled) {
|
||||
// Display error reporting UI
|
||||
|
@ -259,7 +259,7 @@
|
|||
|
||||
if (err == "sslv3Used") {
|
||||
document.getElementById("learnMoreContainer").style.display = "block";
|
||||
var learnMoreLink = document.getElementById("learnMoreLink");
|
||||
let learnMoreLink = document.getElementById("learnMoreLink");
|
||||
learnMoreLink.href = "https://support.mozilla.org/kb/how-resolve-sslv3-error-messages-firefox";
|
||||
document.body.className = "certerror";
|
||||
}
|
||||
|
@ -305,7 +305,7 @@
|
|||
// Pinning errors are of type nssFailure2
|
||||
if (getErrorCode() == "nssFailure2" || getErrorCode() == "weakCryptoUsed") {
|
||||
document.getElementById("learnMoreContainer").style.display = "block";
|
||||
var learnMoreLink = document.getElementById("learnMoreLink");
|
||||
let learnMoreLink = document.getElementById("learnMoreLink");
|
||||
// nssFailure2 also gets us other non-overrideable errors. Choose
|
||||
// a "learn more" link based on description:
|
||||
if (getDescription().includes("mozilla_pkix_error_key_pinning_failure")) {
|
||||
|
@ -324,9 +324,10 @@
|
|||
checkbox.checked = true;
|
||||
}
|
||||
|
||||
checkbox.addEventListener("change", function(evt) {
|
||||
checkbox.addEventListener("change", function(changeEvt) {
|
||||
var event = new CustomEvent("AboutNetErrorSetAutomatic",
|
||||
{bubbles:true, detail:evt.target.checked});
|
||||
{bubbles: true,
|
||||
detail: changeEvt.target.checked});
|
||||
document.dispatchEvent(event);
|
||||
}, false);
|
||||
}
|
||||
|
|
|
@ -29,10 +29,6 @@ function log(msg) {
|
|||
// dump("FXA: " + msg + "\n");
|
||||
}
|
||||
|
||||
function error(msg) {
|
||||
console.log("Firefox Account Error: " + msg + "\n");
|
||||
}
|
||||
|
||||
function getPreviousAccountNameHash() {
|
||||
try {
|
||||
return Services.prefs.getComplexValue(PREF_LAST_FXA_USER, Ci.nsISupportsString).data;
|
||||
|
@ -105,7 +101,7 @@ function updateDisplayedEmail(user) {
|
|||
var wrapper = {
|
||||
iframe: null,
|
||||
|
||||
init: function (url, urlParams) {
|
||||
init: function(url, urlParams) {
|
||||
// If a master-password is enabled, we want to encourage the user to
|
||||
// unlock it. Things still work if not, but the user will probably need
|
||||
// to re-auth next startup (in which case we will get here again and
|
||||
|
@ -134,7 +130,7 @@ var wrapper = {
|
|||
webNav.loadURI(url, Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY, null, null, null);
|
||||
},
|
||||
|
||||
retry: function () {
|
||||
retry: function() {
|
||||
let webNav = this.iframe.frameLoader.docShell.QueryInterface(Ci.nsIWebNavigation);
|
||||
webNav.loadURI(this.url, Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY, null, null, null);
|
||||
},
|
||||
|
@ -180,7 +176,7 @@ var wrapper = {
|
|||
onSecurityChange: function() {},
|
||||
},
|
||||
|
||||
handleEvent: function (evt) {
|
||||
handleEvent: function(evt) {
|
||||
switch (evt.type) {
|
||||
case "load":
|
||||
this.iframe.contentWindow.addEventListener("FirefoxAccountsCommand", this);
|
||||
|
@ -198,7 +194,7 @@ var wrapper = {
|
|||
*
|
||||
* @param accountData the user's account data and credentials
|
||||
*/
|
||||
onLogin: function (accountData) {
|
||||
onLogin: function(accountData) {
|
||||
log("Received: 'login'. Data:" + JSON.stringify(accountData));
|
||||
|
||||
if (accountData.customizeSync) {
|
||||
|
@ -264,7 +260,7 @@ var wrapper = {
|
|||
/**
|
||||
* onSignOut handler erases the current user's session from the fxaccounts service
|
||||
*/
|
||||
onSignOut: function () {
|
||||
onSignOut: function() {
|
||||
log("Received: 'sign_out'.");
|
||||
|
||||
fxAccounts.signOut().then(
|
||||
|
@ -273,7 +269,7 @@ var wrapper = {
|
|||
);
|
||||
},
|
||||
|
||||
handleRemoteCommand: function (evt) {
|
||||
handleRemoteCommand: function(evt) {
|
||||
log('command: ' + evt.detail.command);
|
||||
let data = evt.detail.data;
|
||||
|
||||
|
@ -293,7 +289,7 @@ var wrapper = {
|
|||
}
|
||||
},
|
||||
|
||||
injectData: function (type, content) {
|
||||
injectData: function(type, content) {
|
||||
return fxAccounts.promiseAccountsSignUpURI().then(authUrl => {
|
||||
let data = {
|
||||
type: type,
|
||||
|
|
|
@ -15,40 +15,40 @@ const PREF_UNIFIED = "toolkit.telemetry.unified";
|
|||
const PREF_REPORTING_URL = "datareporting.healthreport.about.reportUrl";
|
||||
|
||||
var healthReportWrapper = {
|
||||
init: function () {
|
||||
init: function() {
|
||||
let iframe = document.getElementById("remote-report");
|
||||
iframe.addEventListener("load", healthReportWrapper.initRemotePage, false);
|
||||
iframe.src = this._getReportURI().spec;
|
||||
prefs.observe("uploadEnabled", this.updatePrefState, healthReportWrapper);
|
||||
},
|
||||
|
||||
uninit: function () {
|
||||
uninit: function() {
|
||||
prefs.ignore("uploadEnabled", this.updatePrefState, healthReportWrapper);
|
||||
},
|
||||
|
||||
_getReportURI: function () {
|
||||
_getReportURI: function() {
|
||||
let url = Services.urlFormatter.formatURLPref(PREF_REPORTING_URL);
|
||||
return Services.io.newURI(url, null, null);
|
||||
},
|
||||
|
||||
setDataSubmission: function (enabled) {
|
||||
setDataSubmission: function(enabled) {
|
||||
MozSelfSupport.healthReportDataSubmissionEnabled = enabled;
|
||||
this.updatePrefState();
|
||||
},
|
||||
|
||||
updatePrefState: function () {
|
||||
updatePrefState: function() {
|
||||
try {
|
||||
let prefs = {
|
||||
let prefsObj = {
|
||||
enabled: MozSelfSupport.healthReportDataSubmissionEnabled,
|
||||
};
|
||||
healthReportWrapper.injectData("prefs", prefs);
|
||||
healthReportWrapper.injectData("prefs", prefsObj);
|
||||
}
|
||||
catch (ex) {
|
||||
healthReportWrapper.reportFailure(healthReportWrapper.ERROR_PREFS_FAILED);
|
||||
}
|
||||
},
|
||||
|
||||
sendTelemetryPingList: function () {
|
||||
sendTelemetryPingList: function() {
|
||||
console.log("AboutHealthReport: Collecting Telemetry ping list.");
|
||||
MozSelfSupport.getTelemetryPingList().then((list) => {
|
||||
console.log("AboutHealthReport: Sending Telemetry ping list.");
|
||||
|
@ -58,7 +58,7 @@ var healthReportWrapper = {
|
|||
});
|
||||
},
|
||||
|
||||
sendTelemetryPingData: function (pingId) {
|
||||
sendTelemetryPingData: function(pingId) {
|
||||
console.log("AboutHealthReport: Collecting Telemetry ping data.");
|
||||
MozSelfSupport.getTelemetryPing(pingId).then((ping) => {
|
||||
console.log("AboutHealthReport: Sending Telemetry ping data.");
|
||||
|
@ -75,7 +75,7 @@ var healthReportWrapper = {
|
|||
});
|
||||
},
|
||||
|
||||
sendCurrentEnvironment: function () {
|
||||
sendCurrentEnvironment: function() {
|
||||
console.log("AboutHealthReport: Sending Telemetry environment data.");
|
||||
MozSelfSupport.getCurrentTelemetryEnvironment().then((environment) => {
|
||||
this.injectData("telemetry-current-environment-data", environment);
|
||||
|
@ -84,7 +84,7 @@ var healthReportWrapper = {
|
|||
});
|
||||
},
|
||||
|
||||
sendCurrentPingData: function () {
|
||||
sendCurrentPingData: function() {
|
||||
console.log("AboutHealthReport: Sending current Telemetry ping data.");
|
||||
MozSelfSupport.getCurrentTelemetrySubsessionPing().then((ping) => {
|
||||
this.injectData("telemetry-current-ping-data", ping);
|
||||
|
@ -93,7 +93,7 @@ var healthReportWrapper = {
|
|||
});
|
||||
},
|
||||
|
||||
injectData: function (type, content) {
|
||||
injectData: function(type, content) {
|
||||
let report = this._getReportURI();
|
||||
|
||||
// file URIs can't be used for targetOrigin, so we use "*" for this special case
|
||||
|
@ -109,7 +109,7 @@ var healthReportWrapper = {
|
|||
iframe.contentWindow.postMessage(data, reportUrl);
|
||||
},
|
||||
|
||||
handleRemoteCommand: function (evt) {
|
||||
handleRemoteCommand: function(evt) {
|
||||
// Do an origin check to harden against the frame content being loaded from unexpected locations.
|
||||
let allowedPrincipal = Services.scriptSecurityManager.getCodebasePrincipal(this._getReportURI());
|
||||
let targetPrincipal = evt.target.nodePrincipal;
|
||||
|
@ -147,7 +147,7 @@ var healthReportWrapper = {
|
|||
}
|
||||
},
|
||||
|
||||
initRemotePage: function () {
|
||||
initRemotePage: function() {
|
||||
let iframe = document.getElementById("remote-report").contentDocument;
|
||||
iframe.addEventListener("RemoteHealthReportCommand",
|
||||
function onCommand(e) { healthReportWrapper.handleRemoteCommand(e); },
|
||||
|
@ -160,21 +160,21 @@ var healthReportWrapper = {
|
|||
ERROR_PAYLOAD_FAILED: 2,
|
||||
ERROR_PREFS_FAILED: 3,
|
||||
|
||||
reportFailure: function (error) {
|
||||
reportFailure: function(error) {
|
||||
let details = {
|
||||
errorType: error,
|
||||
}
|
||||
healthReportWrapper.injectData("error", details);
|
||||
},
|
||||
|
||||
handleInitFailure: function () {
|
||||
handleInitFailure: function() {
|
||||
healthReportWrapper.reportFailure(healthReportWrapper.ERROR_INIT_FAILED);
|
||||
},
|
||||
|
||||
handlePayloadFailure: function () {
|
||||
handlePayloadFailure: function() {
|
||||
healthReportWrapper.reportFailure(healthReportWrapper.ERROR_PAYLOAD_FAILED);
|
||||
},
|
||||
}
|
||||
|
||||
window.addEventListener("load", function () { healthReportWrapper.init(); });
|
||||
window.addEventListener("unload", function () { healthReportWrapper.uninit(); });
|
||||
window.addEventListener("load", function() { healthReportWrapper.init(); });
|
||||
window.addEventListener("unload", function() { healthReportWrapper.uninit(); });
|
||||
|
|
|
@ -27,7 +27,7 @@ var searchText;
|
|||
|
||||
// This global tracks if the page has been set up before, to prevent double inits
|
||||
var gInitialized = false;
|
||||
var gObserver = new MutationObserver(function (mutations) {
|
||||
var gObserver = new MutationObserver(function(mutations) {
|
||||
for (let mutation of mutations) {
|
||||
// The addition of the restore session button changes our width:
|
||||
if (mutation.attributeName == "session") {
|
||||
|
@ -43,7 +43,7 @@ var gObserver = new MutationObserver(function (mutations) {
|
|||
}
|
||||
});
|
||||
|
||||
window.addEventListener("pageshow", function () {
|
||||
window.addEventListener("pageshow", function() {
|
||||
// Delay search engine setup, cause browser.js::BrowserOnAboutPageLoad runs
|
||||
// later and may use asynchronous getters.
|
||||
window.gObserver.observe(document.documentElement, { attributes: true });
|
||||
|
@ -118,7 +118,7 @@ function ensureSnippetsMapThen(aCallback)
|
|||
return;
|
||||
}
|
||||
|
||||
let invokeCallbacks = function () {
|
||||
let invokeCallbacks = function() {
|
||||
if (!gSnippetsMap) {
|
||||
gSnippetsMap = Object.freeze(new Map());
|
||||
}
|
||||
|
@ -132,29 +132,29 @@ function ensureSnippetsMapThen(aCallback)
|
|||
let openRequest = indexedDB.open(DATABASE_NAME, {version: DATABASE_VERSION,
|
||||
storage: DATABASE_STORAGE});
|
||||
|
||||
openRequest.onerror = function (event) {
|
||||
openRequest.onerror = function(event) {
|
||||
// Try to delete the old database so that we can start this process over
|
||||
// next time.
|
||||
indexedDB.deleteDatabase(DATABASE_NAME);
|
||||
invokeCallbacks();
|
||||
};
|
||||
|
||||
openRequest.onupgradeneeded = function (event) {
|
||||
openRequest.onupgradeneeded = function(event) {
|
||||
let db = event.target.result;
|
||||
if (!db.objectStoreNames.contains(SNIPPETS_OBJECTSTORE_NAME)) {
|
||||
db.createObjectStore(SNIPPETS_OBJECTSTORE_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
openRequest.onsuccess = function (event) {
|
||||
openRequest.onsuccess = function(event) {
|
||||
let db = event.target.result;
|
||||
|
||||
db.onerror = function (event) {
|
||||
db.onerror = function() {
|
||||
invokeCallbacks();
|
||||
}
|
||||
|
||||
db.onversionchange = function (event) {
|
||||
event.target.close();
|
||||
db.onversionchange = function(versionChangeEvent) {
|
||||
versionChangeEvent.target.close();
|
||||
invokeCallbacks();
|
||||
}
|
||||
|
||||
|
@ -169,12 +169,12 @@ function ensureSnippetsMapThen(aCallback)
|
|||
return;
|
||||
}
|
||||
|
||||
cursorRequest.onerror = function (event) {
|
||||
cursorRequest.onerror = function() {
|
||||
invokeCallbacks();
|
||||
}
|
||||
|
||||
cursorRequest.onsuccess = function(event) {
|
||||
let cursor = event.target.result;
|
||||
cursorRequest.onsuccess = function(cursorRequestEvent) {
|
||||
let cursor = cursorRequestEvent.target.result;
|
||||
|
||||
// Populate the cache from the persistent storage.
|
||||
if (cursor) {
|
||||
|
@ -186,18 +186,18 @@ function ensureSnippetsMapThen(aCallback)
|
|||
// The cache has been filled up, create the snippets map.
|
||||
gSnippetsMap = Object.freeze({
|
||||
get: (aKey) => cache.get(aKey),
|
||||
set: function (aKey, aValue) {
|
||||
set: function(aKey, aValue) {
|
||||
db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite")
|
||||
.objectStore(SNIPPETS_OBJECTSTORE_NAME).put(aValue, aKey);
|
||||
return cache.set(aKey, aValue);
|
||||
},
|
||||
has: (aKey) => cache.has(aKey),
|
||||
delete: function (aKey) {
|
||||
delete: function(aKey) {
|
||||
db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite")
|
||||
.objectStore(SNIPPETS_OBJECTSTORE_NAME).delete(aKey);
|
||||
return cache.delete(aKey);
|
||||
},
|
||||
clear: function () {
|
||||
clear: function() {
|
||||
db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite")
|
||||
.objectStore(SNIPPETS_OBJECTSTORE_NAME).clear();
|
||||
return cache.clear();
|
||||
|
@ -283,7 +283,7 @@ function loadSnippets()
|
|||
// Even if fetching should fail we don't want to spam the server, thus
|
||||
// set the last update time regardless its results. Will retry tomorrow.
|
||||
gSnippetsMap.set("snippets-last-update", Date.now());
|
||||
xhr.onloadend = function (event) {
|
||||
xhr.onloadend = function() {
|
||||
if (xhr.status == 200) {
|
||||
gSnippetsMap.set("snippets", xhr.responseText);
|
||||
gSnippetsMap.set("snippets-cached-version", currentVersion);
|
||||
|
|
|
@ -30,7 +30,7 @@ function removeNotificationOnEnd(notification, installs) {
|
|||
}
|
||||
|
||||
const gXPInstallObserver = {
|
||||
_findChildShell: function (aDocShell, aSoughtShell)
|
||||
_findChildShell: function(aDocShell, aSoughtShell)
|
||||
{
|
||||
if (aDocShell == aSoughtShell)
|
||||
return aDocShell;
|
||||
|
@ -45,7 +45,7 @@ const gXPInstallObserver = {
|
|||
return null;
|
||||
},
|
||||
|
||||
_getBrowser: function (aDocShell)
|
||||
_getBrowser: function(aDocShell)
|
||||
{
|
||||
for (let browser of gBrowser.browsers) {
|
||||
if (this._findChildShell(browser.docShell, aDocShell))
|
||||
|
@ -132,10 +132,12 @@ const gXPInstallObserver = {
|
|||
container.appendChild(name);
|
||||
|
||||
if (someUnsigned && install.addon.signedState <= AddonManager.SIGNEDSTATE_MISSING) {
|
||||
let unsigned = document.createElement("label");
|
||||
unsigned.setAttribute("value", gNavigatorBundle.getString("addonInstall.unsigned"));
|
||||
unsigned.setAttribute("class", "addon-install-confirmation-unsigned");
|
||||
container.appendChild(unsigned);
|
||||
let unsignedLabel = document.createElement("label");
|
||||
unsignedLabel.setAttribute("value",
|
||||
gNavigatorBundle.getString("addonInstall.unsigned"));
|
||||
unsignedLabel.setAttribute("class",
|
||||
"addon-install-confirmation-unsigned");
|
||||
container.appendChild(unsignedLabel);
|
||||
}
|
||||
|
||||
addonList.appendChild(container);
|
||||
|
@ -194,7 +196,6 @@ const gXPInstallObserver = {
|
|||
acceptButton.accessKey = gNavigatorBundle.getString("addonInstall.acceptButton.accesskey");
|
||||
|
||||
if (height) {
|
||||
let notification = document.getElementById("addon-install-confirmation-notification");
|
||||
notification.style.minHeight = height + "px";
|
||||
}
|
||||
|
||||
|
@ -214,7 +215,7 @@ const gXPInstallObserver = {
|
|||
.add(Ci.nsISecurityUITelemetry.WARNING_CONFIRM_ADDON_INSTALL);
|
||||
},
|
||||
|
||||
observe: function (aSubject, aTopic, aData)
|
||||
observe: function(aSubject, aTopic, aData)
|
||||
{
|
||||
var brandBundle = document.getElementById("bundle_brand");
|
||||
var installInfo = aSubject.QueryInterface(Components.interfaces.amIWebInstallInfo);
|
||||
|
@ -442,14 +443,14 @@ const gXPInstallObserver = {
|
|||
};
|
||||
|
||||
var LightWeightThemeWebInstaller = {
|
||||
init: function () {
|
||||
init: function() {
|
||||
let mm = window.messageManager;
|
||||
mm.addMessageListener("LightWeightThemeWebInstaller:Install", this);
|
||||
mm.addMessageListener("LightWeightThemeWebInstaller:Preview", this);
|
||||
mm.addMessageListener("LightWeightThemeWebInstaller:ResetPreview", this);
|
||||
},
|
||||
|
||||
receiveMessage: function (message) {
|
||||
receiveMessage: function(message) {
|
||||
// ignore requests from background tabs
|
||||
if (message.target != gBrowser.selectedBrowser) {
|
||||
return;
|
||||
|
@ -473,7 +474,7 @@ var LightWeightThemeWebInstaller = {
|
|||
}
|
||||
},
|
||||
|
||||
handleEvent: function (event) {
|
||||
handleEvent: function(event) {
|
||||
switch (event.type) {
|
||||
case "TabSelect": {
|
||||
this._resetPreview();
|
||||
|
@ -482,14 +483,14 @@ var LightWeightThemeWebInstaller = {
|
|||
}
|
||||
},
|
||||
|
||||
get _manager () {
|
||||
get _manager() {
|
||||
let temp = {};
|
||||
Cu.import("resource://gre/modules/LightweightThemeManager.jsm", temp);
|
||||
delete this._manager;
|
||||
return this._manager = temp.LightweightThemeManager;
|
||||
},
|
||||
|
||||
_installRequest: function (dataString, baseURI) {
|
||||
_installRequest: function(dataString, baseURI) {
|
||||
let data = this._manager.parseTheme(dataString, baseURI);
|
||||
|
||||
if (!data) {
|
||||
|
@ -530,7 +531,7 @@ var LightWeightThemeWebInstaller = {
|
|||
let buttons = [{
|
||||
label: allowButtonText,
|
||||
accessKey: allowButtonAccesskey,
|
||||
callback: function () {
|
||||
callback: function() {
|
||||
LightWeightThemeWebInstaller._install(data, notify);
|
||||
}
|
||||
}];
|
||||
|
@ -545,7 +546,7 @@ var LightWeightThemeWebInstaller = {
|
|||
notificationBar.persistence = 1;
|
||||
},
|
||||
|
||||
_install: function (newLWTheme, notify) {
|
||||
_install: function(newLWTheme, notify) {
|
||||
let previousLWTheme = this._manager.currentTheme;
|
||||
|
||||
let listener = {
|
||||
|
@ -560,7 +561,7 @@ var LightWeightThemeWebInstaller = {
|
|||
let action = {
|
||||
label: gNavigatorBundle.getString("lwthemeNeedsRestart.button"),
|
||||
accessKey: gNavigatorBundle.getString("lwthemeNeedsRestart.accesskey"),
|
||||
callback: function () {
|
||||
callback: function() {
|
||||
BrowserUtils.restartApplication();
|
||||
}
|
||||
};
|
||||
|
@ -586,7 +587,7 @@ var LightWeightThemeWebInstaller = {
|
|||
AddonManager.removeAddonListener(listener);
|
||||
},
|
||||
|
||||
_postInstallNotification: function (newTheme, previousTheme) {
|
||||
_postInstallNotification: function(newTheme, previousTheme) {
|
||||
function text(id) {
|
||||
return gNavigatorBundle.getString("lwthemePostInstallNotification." + id);
|
||||
}
|
||||
|
@ -594,14 +595,14 @@ var LightWeightThemeWebInstaller = {
|
|||
let buttons = [{
|
||||
label: text("undoButton"),
|
||||
accessKey: text("undoButton.accesskey"),
|
||||
callback: function () {
|
||||
callback: function() {
|
||||
LightWeightThemeWebInstaller._manager.forgetUsedTheme(newTheme.id);
|
||||
LightWeightThemeWebInstaller._manager.currentTheme = previousTheme;
|
||||
}
|
||||
}, {
|
||||
label: text("manageButton"),
|
||||
accessKey: text("manageButton.accesskey"),
|
||||
callback: function () {
|
||||
callback: function() {
|
||||
BrowserOpenAddonsMgr("addons://list/theme");
|
||||
}
|
||||
}];
|
||||
|
@ -618,18 +619,18 @@ var LightWeightThemeWebInstaller = {
|
|||
notificationBar.timeout = Date.now() + 20000; // 20 seconds
|
||||
},
|
||||
|
||||
_removePreviousNotifications: function () {
|
||||
_removePreviousNotifications: function() {
|
||||
let box = gBrowser.getNotificationBox();
|
||||
|
||||
["lwtheme-install-request",
|
||||
"lwtheme-install-notification"].forEach(function (value) {
|
||||
"lwtheme-install-notification"].forEach(function(value) {
|
||||
let notification = box.getNotificationWithValue(value);
|
||||
if (notification)
|
||||
box.removeNotification(notification);
|
||||
});
|
||||
},
|
||||
|
||||
_preview: function (dataString, baseURI) {
|
||||
_preview: function(dataString, baseURI) {
|
||||
if (!this._isAllowed(baseURI))
|
||||
return;
|
||||
|
||||
|
@ -642,14 +643,14 @@ var LightWeightThemeWebInstaller = {
|
|||
this._manager.previewTheme(data);
|
||||
},
|
||||
|
||||
_resetPreview: function (baseURI) {
|
||||
_resetPreview: function(baseURI) {
|
||||
if (baseURI && !this._isAllowed(baseURI))
|
||||
return;
|
||||
gBrowser.tabContainer.removeEventListener("TabSelect", this, false);
|
||||
this._manager.resetPreview();
|
||||
},
|
||||
|
||||
_isAllowed: function (srcURIString) {
|
||||
_isAllowed: function(srcURIString) {
|
||||
let uri;
|
||||
try {
|
||||
uri = makeURI(srcURIString);
|
||||
|
@ -674,7 +675,7 @@ var LightWeightThemeWebInstaller = {
|
|||
var LightweightThemeListener = {
|
||||
_modifiedStyles: [],
|
||||
|
||||
init: function () {
|
||||
init: function() {
|
||||
XPCOMUtils.defineLazyGetter(this, "styleSheet", function() {
|
||||
for (let i = document.styleSheets.length - 1; i >= 0; i--) {
|
||||
let sheet = document.styleSheets[i];
|
||||
|
@ -690,7 +691,7 @@ var LightweightThemeListener = {
|
|||
this.updateStyleSheet(document.documentElement.style.backgroundImage);
|
||||
},
|
||||
|
||||
uninit: function () {
|
||||
uninit: function() {
|
||||
Services.obs.removeObserver(this, "lightweight-theme-styling-update");
|
||||
Services.obs.removeObserver(this, "lightweight-theme-optimized");
|
||||
},
|
||||
|
@ -731,7 +732,7 @@ var LightweightThemeListener = {
|
|||
},
|
||||
|
||||
// nsIObserver
|
||||
observe: function (aSubject, aTopic, aData) {
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
if ((aTopic != "lightweight-theme-styling-update" && aTopic != "lightweight-theme-optimized") ||
|
||||
!this.styleSheet)
|
||||
return;
|
||||
|
|
|
@ -48,7 +48,7 @@ var tabPreviews = {
|
|||
let canvas = PageThumbs.createCanvas(window);
|
||||
PageThumbs.shouldStoreThumbnail(browser, (aDoStore) => {
|
||||
if (aDoStore && aShouldCache) {
|
||||
PageThumbs.captureAndStore(browser, function () {
|
||||
PageThumbs.captureAndStore(browser, function() {
|
||||
let img = new Image;
|
||||
img.src = PageThumbs.getThumbnailURL(uri);
|
||||
aTab.__thumbnail = img;
|
||||
|
@ -78,7 +78,7 @@ var tabPreviews = {
|
|||
// for tabs that will be closed. During that timeout, don't generate other
|
||||
// thumbnails in case multiple TabSelect events occur fast in succession.
|
||||
this._pendingUpdate = true;
|
||||
setTimeout(function (self, aTab) {
|
||||
setTimeout(function(self, aTab) {
|
||||
self._pendingUpdate = false;
|
||||
if (aTab.parentNode &&
|
||||
!aTab.hasAttribute("busy") &&
|
||||
|
@ -96,7 +96,7 @@ var tabPreviews = {
|
|||
};
|
||||
|
||||
var tabPreviewPanelHelper = {
|
||||
opening: function (host) {
|
||||
opening: function(host) {
|
||||
host.panel.hidden = false;
|
||||
|
||||
var handler = this._generateHandler(host);
|
||||
|
@ -105,20 +105,20 @@ var tabPreviewPanelHelper = {
|
|||
|
||||
host._prevFocus = document.commandDispatcher.focusedElement;
|
||||
},
|
||||
_generateHandler: function (host) {
|
||||
_generateHandler: function(host) {
|
||||
var self = this;
|
||||
return function (event) {
|
||||
return function(event) {
|
||||
if (event.target == host.panel) {
|
||||
host.panel.removeEventListener(event.type, arguments.callee, false);
|
||||
self["_" + event.type](host);
|
||||
}
|
||||
};
|
||||
},
|
||||
_popupshown: function (host) {
|
||||
_popupshown: function(host) {
|
||||
if ("setupGUI" in host)
|
||||
host.setupGUI();
|
||||
},
|
||||
_popuphiding: function (host) {
|
||||
_popuphiding: function(host) {
|
||||
if ("suspendGUI" in host)
|
||||
host.suspendGUI();
|
||||
|
||||
|
@ -139,33 +139,33 @@ var tabPreviewPanelHelper = {
|
|||
* Ctrl-Tab panel
|
||||
*/
|
||||
var ctrlTab = {
|
||||
get panel () {
|
||||
get panel() {
|
||||
delete this.panel;
|
||||
return this.panel = document.getElementById("ctrlTab-panel");
|
||||
},
|
||||
get showAllButton () {
|
||||
get showAllButton() {
|
||||
delete this.showAllButton;
|
||||
return this.showAllButton = document.getElementById("ctrlTab-showAll");
|
||||
},
|
||||
get previews () {
|
||||
get previews() {
|
||||
delete this.previews;
|
||||
return this.previews = this.panel.getElementsByClassName("ctrlTab-preview");
|
||||
},
|
||||
get maxTabPreviews () {
|
||||
get maxTabPreviews() {
|
||||
delete this.maxTabPreviews;
|
||||
return this.maxTabPreviews = this.previews.length - 1;
|
||||
},
|
||||
get canvasWidth () {
|
||||
get canvasWidth() {
|
||||
delete this.canvasWidth;
|
||||
return this.canvasWidth = Math.ceil(screen.availWidth * .85 / this.maxTabPreviews);
|
||||
},
|
||||
get canvasHeight () {
|
||||
get canvasHeight() {
|
||||
delete this.canvasHeight;
|
||||
return this.canvasHeight = Math.round(this.canvasWidth * tabPreviews.aspectRatio);
|
||||
},
|
||||
get keys () {
|
||||
get keys() {
|
||||
var keys = {};
|
||||
["close", "find", "selectAll"].forEach(function (key) {
|
||||
["close", "find", "selectAll"].forEach(function(key) {
|
||||
keys[key] = document.getElementById("key_" + key)
|
||||
.getAttribute("key")
|
||||
.toLocaleLowerCase().charCodeAt(0);
|
||||
|
@ -174,22 +174,22 @@ var ctrlTab = {
|
|||
return this.keys = keys;
|
||||
},
|
||||
_selectedIndex: 0,
|
||||
get selected () {
|
||||
get selected() {
|
||||
return this._selectedIndex < 0 ?
|
||||
document.activeElement :
|
||||
this.previews.item(this._selectedIndex);
|
||||
},
|
||||
get isOpen () {
|
||||
get isOpen() {
|
||||
return this.panel.state == "open" || this.panel.state == "showing" || this._timer;
|
||||
},
|
||||
get tabCount () {
|
||||
get tabCount() {
|
||||
return this.tabList.length;
|
||||
},
|
||||
get tabPreviewCount () {
|
||||
get tabPreviewCount() {
|
||||
return Math.min(this.maxTabPreviews, this.tabCount);
|
||||
},
|
||||
|
||||
get tabList () {
|
||||
get tabList() {
|
||||
return this._recentlyUsedTabs;
|
||||
},
|
||||
|
||||
|
@ -219,7 +219,7 @@ var ctrlTab = {
|
|||
else
|
||||
this.uninit();
|
||||
},
|
||||
observe: function (aSubject, aTopic, aPrefName) {
|
||||
observe: function(aSubject, aTopic, aPrefName) {
|
||||
this.readPref();
|
||||
},
|
||||
|
||||
|
@ -347,7 +347,7 @@ var ctrlTab = {
|
|||
|
||||
// Add a slight delay before showing the UI, so that a quick
|
||||
// "ctrl-tab" keypress just flips back to the MRU tab.
|
||||
this._timer = setTimeout(function (self) {
|
||||
this._timer = setTimeout(function(self) {
|
||||
self._timer = null;
|
||||
self._openPanel();
|
||||
}, 200, this);
|
||||
|
@ -388,7 +388,7 @@ var ctrlTab = {
|
|||
// Track mouse movement after a brief delay so that the item that happens
|
||||
// to be under the mouse pointer initially won't be selected unintentionally.
|
||||
this._trackMouseOver = false;
|
||||
setTimeout(function (self) {
|
||||
setTimeout(function(self) {
|
||||
if (self.isOpen)
|
||||
self._trackMouseOver = true;
|
||||
}, 0, this);
|
||||
|
@ -462,7 +462,7 @@ var ctrlTab = {
|
|||
|
||||
// If the current tab is removed, another tab can steal our focus.
|
||||
if (aTab.selected && this.panel.state == "open") {
|
||||
setTimeout(function (selected) {
|
||||
setTimeout(function(selected) {
|
||||
selected.focus();
|
||||
}, 0, this.selected);
|
||||
}
|
||||
|
@ -508,7 +508,7 @@ var ctrlTab = {
|
|||
}
|
||||
},
|
||||
|
||||
filterForThumbnailExpiration: function (aCallback) {
|
||||
filterForThumbnailExpiration: function(aCallback) {
|
||||
// Save a few more thumbnails than we actually display, so that when tabs
|
||||
// are closed, the previews we add instead still get thumbnails.
|
||||
const extraThumbnails = 3;
|
||||
|
@ -522,7 +522,7 @@ var ctrlTab = {
|
|||
aCallback(urls);
|
||||
},
|
||||
|
||||
_initRecentlyUsedTabs: function () {
|
||||
_initRecentlyUsedTabs: function() {
|
||||
this._recentlyUsedTabs =
|
||||
Array.filter(gBrowser.tabs, tab => !tab.closing)
|
||||
.sort((tab1, tab2) => tab2.lastAccessed - tab1.lastAccessed);
|
||||
|
|
|
@ -39,11 +39,11 @@ var gDataNotificationInfoBar = {
|
|||
}
|
||||
},
|
||||
|
||||
_getDataReportingNotification: function (name=this._DATA_REPORTING_NOTIFICATION) {
|
||||
_getDataReportingNotification: function(name = this._DATA_REPORTING_NOTIFICATION) {
|
||||
return this._notificationBox.getNotificationWithValue(name);
|
||||
},
|
||||
|
||||
_displayDataPolicyInfoBar: function (request) {
|
||||
_displayDataPolicyInfoBar: function(request) {
|
||||
if (this._getDataReportingNotification()) {
|
||||
return;
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ var gDataNotificationInfoBar = {
|
|||
request.onUserNotifyComplete();
|
||||
},
|
||||
|
||||
_clearPolicyNotification: function () {
|
||||
_clearPolicyNotification: function() {
|
||||
let notification = this._getDataReportingNotification();
|
||||
if (notification) {
|
||||
this._log.debug("Closing notification.");
|
||||
|
|
|
@ -21,7 +21,7 @@ var DevEdition = {
|
|||
return theme && theme.id == "firefox-devedition@mozilla.org";
|
||||
},
|
||||
|
||||
init: function () {
|
||||
init: function() {
|
||||
this.initialized = true;
|
||||
Services.prefs.addObserver(this._devtoolsThemePrefName, this, false);
|
||||
Services.obs.addObserver(this, "lightweight-theme-styling-update", false);
|
||||
|
@ -42,7 +42,7 @@ var DevEdition = {
|
|||
this.styleSheet.sheet.disabled = true;
|
||||
},
|
||||
|
||||
observe: function (subject, topic, data) {
|
||||
observe: function(subject, topic, data) {
|
||||
if (topic == "lightweight-theme-styling-update") {
|
||||
let newTheme = JSON.parse(data);
|
||||
if (newTheme && newTheme.id == "firefox-devedition@mozilla.org") {
|
||||
|
@ -122,7 +122,7 @@ var DevEdition = {
|
|||
}
|
||||
},
|
||||
|
||||
uninit: function () {
|
||||
uninit: function() {
|
||||
Services.prefs.removeObserver(this._devtoolsThemePrefName, this);
|
||||
Services.obs.removeObserver(this, "lightweight-theme-styling-update", false);
|
||||
Services.obs.removeObserver(this, "lightweight-theme-window-updated", false);
|
||||
|
|
|
@ -277,7 +277,7 @@ var FullScreen = {
|
|||
this.cleanup();
|
||||
},
|
||||
|
||||
toggle: function () {
|
||||
toggle: function() {
|
||||
var enterFS = window.fullScreen;
|
||||
|
||||
// Toggle the View:FullScreen command, which controls elements like the
|
||||
|
@ -346,7 +346,7 @@ var FullScreen = {
|
|||
document.exitFullscreen();
|
||||
},
|
||||
|
||||
handleEvent: function (event) {
|
||||
handleEvent: function(event) {
|
||||
switch (event.type) {
|
||||
case "fullscreen":
|
||||
this.toggle();
|
||||
|
@ -456,7 +456,7 @@ var FullScreen = {
|
|||
window.addEventListener("activate", this);
|
||||
},
|
||||
|
||||
cleanup: function () {
|
||||
cleanup: function() {
|
||||
if (!window.fullScreen) {
|
||||
MousePosTracker.removeListener(this);
|
||||
document.removeEventListener("keypress", this._keyToggleCallback, false);
|
||||
|
@ -465,7 +465,7 @@ var FullScreen = {
|
|||
}
|
||||
},
|
||||
|
||||
cleanupDomFullscreen: function () {
|
||||
cleanupDomFullscreen: function() {
|
||||
window.messageManager
|
||||
.broadcastAsyncMessage("DOMFullscreen:CleanUp");
|
||||
|
||||
|
@ -478,7 +478,7 @@ var FullScreen = {
|
|||
document.documentElement.removeAttribute("inDOMFullscreen");
|
||||
},
|
||||
|
||||
_isRemoteBrowser: function (aBrowser) {
|
||||
_isRemoteBrowser: function(aBrowser) {
|
||||
return gMultiProcessBrowser && aBrowser.getAttribute("remote") == "true";
|
||||
},
|
||||
|
||||
|
@ -516,7 +516,7 @@ var FullScreen = {
|
|||
// Checks whether we are allowed to collapse the chrome
|
||||
_isPopupOpen: false,
|
||||
_isChromeCollapsed: false,
|
||||
_safeToCollapse: function () {
|
||||
_safeToCollapse: function() {
|
||||
if (!gPrefService.getBoolPref("browser.fullscreen.autohide"))
|
||||
return false;
|
||||
|
||||
|
@ -591,7 +591,7 @@ var FullScreen = {
|
|||
this._isChromeCollapsed = false;
|
||||
},
|
||||
|
||||
hideNavToolbox: function (aAnimate = false) {
|
||||
hideNavToolbox: function(aAnimate = false) {
|
||||
if (this._isChromeCollapsed || !this._safeToCollapse())
|
||||
return;
|
||||
|
||||
|
@ -615,7 +615,7 @@ var FullScreen = {
|
|||
MousePosTracker.removeListener(this);
|
||||
},
|
||||
|
||||
_updateToolbars: function (aEnterFS) {
|
||||
_updateToolbars: function(aEnterFS) {
|
||||
for (let el of document.querySelectorAll("toolbar[fullscreentoolbar=true]")) {
|
||||
if (aEnterFS) {
|
||||
// Give the main nav bar and the tab bar the fullscreen context menu,
|
||||
|
|
|
@ -89,7 +89,7 @@ var FullZoom = {
|
|||
|
||||
// nsIObserver
|
||||
|
||||
observe: function (aSubject, aTopic, aData) {
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
switch (aTopic) {
|
||||
case "nsPref:changed":
|
||||
switch (aData) {
|
||||
|
@ -154,8 +154,8 @@ var FullZoom = {
|
|||
let hasPref = false;
|
||||
let token = this._getBrowserToken(browser);
|
||||
this._cps2.getByDomainAndName(browser.currentURI.spec, this.name, ctxt, {
|
||||
handleResult: function () { hasPref = true; },
|
||||
handleCompletion: function () {
|
||||
handleResult: function() { hasPref = true; },
|
||||
handleCompletion: function() {
|
||||
if (!hasPref && token.isCurrent)
|
||||
this._applyPrefToZoom(undefined, browser);
|
||||
}.bind(this)
|
||||
|
@ -223,8 +223,8 @@ var FullZoom = {
|
|||
let value = undefined;
|
||||
let token = this._getBrowserToken(browser);
|
||||
this._cps2.getByDomainAndName(aURI.spec, this.name, ctxt, {
|
||||
handleResult: function (resultPref) { value = resultPref.value; },
|
||||
handleCompletion: function () {
|
||||
handleResult: function(resultPref) { value = resultPref.value; },
|
||||
handleCompletion: function() {
|
||||
if (!token.isCurrent) {
|
||||
this._notifyOnLocationChange(browser);
|
||||
return;
|
||||
|
@ -269,7 +269,7 @@ var FullZoom = {
|
|||
* Sets the zoom level for the given browser to the given floating
|
||||
* point value, where 1 is the default zoom level.
|
||||
*/
|
||||
setZoom: function (value, browser = gBrowser.selectedBrowser) {
|
||||
setZoom: function(value, browser = gBrowser.selectedBrowser) {
|
||||
ZoomManager.setZoomForBrowser(browser, value);
|
||||
this._ignorePendingZoomAccesses(browser);
|
||||
this._applyZoomToPref(browser);
|
||||
|
@ -364,7 +364,7 @@ var FullZoom = {
|
|||
this._cps2.set(browser.currentURI.spec, this.name,
|
||||
ZoomManager.getZoomForBrowser(browser),
|
||||
this._loadContextFromBrowser(browser), {
|
||||
handleCompletion: function () {
|
||||
handleCompletion: function() {
|
||||
this._isNextContentPrefChangeInternal = true;
|
||||
}.bind(this),
|
||||
});
|
||||
|
@ -381,7 +381,7 @@ var FullZoom = {
|
|||
return;
|
||||
let ctxt = this._loadContextFromBrowser(browser);
|
||||
this._cps2.removeByDomainAndName(browser.currentURI.spec, this.name, ctxt, {
|
||||
handleCompletion: function () {
|
||||
handleCompletion: function() {
|
||||
this._isNextContentPrefChangeInternal = true;
|
||||
}.bind(this),
|
||||
});
|
||||
|
@ -487,7 +487,7 @@ var FullZoom = {
|
|||
}
|
||||
let value = undefined;
|
||||
this._cps2.getGlobal(this.name, this._loadContextFromBrowser(browser), {
|
||||
handleResult: function (pref) { value = pref.value; },
|
||||
handleResult: function(pref) { value = pref.value; },
|
||||
handleCompletion: (reason) => {
|
||||
this._globalValue = this._ensureValid(value);
|
||||
resolve(this._globalValue);
|
||||
|
@ -513,7 +513,7 @@ var FullZoom = {
|
|||
* consistent behavior.
|
||||
*/
|
||||
_notifyOnLocationChange: function FullZoom__notifyOnLocationChange(browser) {
|
||||
this._executeSoon(function () {
|
||||
this._executeSoon(function() {
|
||||
Services.obs.notifyObservers(browser, "browser-fullZoom:location-change", "");
|
||||
});
|
||||
},
|
||||
|
|
|
@ -87,7 +87,7 @@ var gFxAccounts = {
|
|||
.sort((a, b) => a.name.localeCompare(b.name));
|
||||
},
|
||||
|
||||
init: function () {
|
||||
init: function() {
|
||||
// Bail out if we're already initialized and for pop-up windows.
|
||||
if (this._initialized || !window.toolbar.visible) {
|
||||
return;
|
||||
|
@ -106,7 +106,7 @@ var gFxAccounts = {
|
|||
this.updateUI();
|
||||
},
|
||||
|
||||
uninit: function () {
|
||||
uninit: function() {
|
||||
if (!this._initialized) {
|
||||
return;
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ var gFxAccounts = {
|
|||
this._initialized = false;
|
||||
},
|
||||
|
||||
observe: function (subject, topic, data) {
|
||||
observe: function(subject, topic, data) {
|
||||
switch (topic) {
|
||||
case "fxa-migration:state-changed":
|
||||
this.onMigrationStateChanged(data, subject);
|
||||
|
@ -132,7 +132,7 @@ var gFxAccounts = {
|
|||
}
|
||||
},
|
||||
|
||||
onMigrationStateChanged: function () {
|
||||
onMigrationStateChanged: function() {
|
||||
// Since we nuked most of the migration code, this notification will fire
|
||||
// once after legacy Sync has been disconnected (and should never fire
|
||||
// again)
|
||||
|
@ -174,12 +174,12 @@ var gFxAccounts = {
|
|||
this.updateAppMenuItem();
|
||||
},
|
||||
|
||||
handleEvent: function (event) {
|
||||
handleEvent: function(event) {
|
||||
this._inCustomizationMode = event.type == "customizationstarting";
|
||||
this.updateAppMenuItem();
|
||||
},
|
||||
|
||||
updateUI: function () {
|
||||
updateUI: function() {
|
||||
// It's possible someone signed in to FxA after seeing our notification
|
||||
// about "Legacy Sync migration" (which now is actually "Legacy Sync
|
||||
// auto-disconnect") so kill that notification if it still exists.
|
||||
|
@ -193,7 +193,7 @@ var gFxAccounts = {
|
|||
},
|
||||
|
||||
// Note that updateAppMenuItem() returns a Promise that's only used by tests.
|
||||
updateAppMenuItem: function () {
|
||||
updateAppMenuItem: function() {
|
||||
let profileInfoEnabled = false;
|
||||
try {
|
||||
profileInfoEnabled = Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled");
|
||||
|
@ -319,7 +319,7 @@ var gFxAccounts = {
|
|||
});
|
||||
},
|
||||
|
||||
onMenuPanelCommand: function () {
|
||||
onMenuPanelCommand: function() {
|
||||
|
||||
switch (this.panelUIFooter.getAttribute("fxastatus")) {
|
||||
case "signedin":
|
||||
|
@ -340,11 +340,11 @@ var gFxAccounts = {
|
|||
PanelUI.hide();
|
||||
},
|
||||
|
||||
openPreferences: function () {
|
||||
openPreferences: function() {
|
||||
openPreferences("paneSync", { urlParams: { entrypoint: "menupanel" } });
|
||||
},
|
||||
|
||||
openAccountsPage: function (action, urlParams={}) {
|
||||
openAccountsPage: function(action, urlParams = {}) {
|
||||
let params = new URLSearchParams();
|
||||
if (action) {
|
||||
params.set("action", action);
|
||||
|
@ -360,15 +360,15 @@ var gFxAccounts = {
|
|||
});
|
||||
},
|
||||
|
||||
openSignInAgainPage: function (entryPoint) {
|
||||
openSignInAgainPage: function(entryPoint) {
|
||||
this.openAccountsPage("reauth", { entrypoint: entryPoint });
|
||||
},
|
||||
|
||||
sendTabToDevice: function (url, clientId, title) {
|
||||
sendTabToDevice: function(url, clientId, title) {
|
||||
Weave.Service.clientsEngine.sendURIToClientForDisplay(url, clientId, title);
|
||||
},
|
||||
|
||||
populateSendTabToDevicesMenu: function (devicesPopup, url, title) {
|
||||
populateSendTabToDevicesMenu: function(devicesPopup, url, title) {
|
||||
// remove existing menu items
|
||||
while (devicesPopup.hasChildNodes()) {
|
||||
devicesPopup.removeChild(devicesPopup.firstChild);
|
||||
|
@ -377,10 +377,9 @@ var gFxAccounts = {
|
|||
const fragment = document.createDocumentFragment();
|
||||
|
||||
const onTargetDeviceCommand = (event) => {
|
||||
const clientId = event.target.getAttribute("clientId");
|
||||
const clients = clientId
|
||||
? [clientId]
|
||||
: this.remoteClients.map(client => client.id);
|
||||
let clients = event.target.getAttribute("clientId") ?
|
||||
[event.target.getAttribute("clientId")] :
|
||||
this.remoteClients.map(client => client.id);
|
||||
|
||||
clients.forEach(clientId => this.sendTabToDevice(url, clientId, title));
|
||||
}
|
||||
|
@ -410,7 +409,7 @@ var gFxAccounts = {
|
|||
devicesPopup.appendChild(fragment);
|
||||
},
|
||||
|
||||
updateTabContextMenu: function (aPopupMenu) {
|
||||
updateTabContextMenu: function(aPopupMenu) {
|
||||
if (!this.sendTabToDeviceEnabled) {
|
||||
return;
|
||||
}
|
||||
|
@ -420,7 +419,7 @@ var gFxAccounts = {
|
|||
.forEach(id => { document.getElementById(id).hidden = !remoteClientPresent });
|
||||
},
|
||||
|
||||
initPageContextMenu: function (contextMenu) {
|
||||
initPageContextMenu: function(contextMenu) {
|
||||
if (!this.sendTabToDeviceEnabled) {
|
||||
return;
|
||||
}
|
||||
|
@ -442,7 +441,7 @@ var gFxAccounts = {
|
|||
}
|
||||
};
|
||||
|
||||
XPCOMUtils.defineLazyGetter(gFxAccounts, "FxAccountsCommon", function () {
|
||||
XPCOMUtils.defineLazyGetter(gFxAccounts, "FxAccountsCommon", function() {
|
||||
return Cu.import("resource://gre/modules/FxAccountsCommon.js", {});
|
||||
});
|
||||
|
||||
|
|
|
@ -134,9 +134,9 @@ var gGestureSupport = {
|
|||
let isLatched = false;
|
||||
|
||||
// Create the update function here to capture closure state
|
||||
this._doUpdate = function GS__doUpdate(aEvent) {
|
||||
this._doUpdate = function GS__doUpdate(updateEvent) {
|
||||
// Update the offset with new event data
|
||||
offset += aEvent.delta;
|
||||
offset += updateEvent.delta;
|
||||
|
||||
// Check if the cumulative deltas exceed the threshold
|
||||
if (Math.abs(offset) > aPref["threshold"]) {
|
||||
|
@ -145,7 +145,7 @@ var gGestureSupport = {
|
|||
// initial motion; or we're latched and going the opposite way
|
||||
let sameDir = (latchDir ^ offset) >= 0;
|
||||
if (!aPref["latched"] || (isLatched ^ sameDir)) {
|
||||
this._doAction(aEvent, [aGesture, offset > 0 ? aInc : aDec]);
|
||||
this._doAction(updateEvent, [aGesture, offset > 0 ? aInc : aDec]);
|
||||
|
||||
// We must be getting latched or leaving it, so just toggle
|
||||
isLatched = !isLatched;
|
||||
|
@ -242,8 +242,8 @@ var gGestureSupport = {
|
|||
this._doEnd = function GS__doEnd(aEvent) {
|
||||
gHistorySwipeAnimation.swipeEndEventReceived();
|
||||
|
||||
this._doUpdate = function (aEvent) {};
|
||||
this._doEnd = function (aEvent) {};
|
||||
this._doUpdate = function() {};
|
||||
this._doEnd = function() {};
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -260,7 +260,7 @@ var gGestureSupport = {
|
|||
let num = 1 << aArray.length;
|
||||
while (--num >= 0) {
|
||||
// Only select array elements where the current bit is set
|
||||
yield aArray.reduce(function (aPrev, aCurr, aIndex) {
|
||||
yield aArray.reduce(function(aPrev, aCurr, aIndex) {
|
||||
if (num & 1 << aIndex)
|
||||
aPrev.push(aCurr);
|
||||
return aPrev;
|
||||
|
|
|
@ -144,7 +144,7 @@ var gEMEHandler = {
|
|||
var box = gBrowser.getNotificationBox(browser);
|
||||
["drmContentDisabled",
|
||||
"drmContentCDMInstalling"
|
||||
].forEach(function (value) {
|
||||
].forEach(function(value) {
|
||||
var notification = box.getNotificationWithValue(value);
|
||||
if (notification)
|
||||
box.removeNotification(notification);
|
||||
|
|
|
@ -36,7 +36,7 @@ var StarUI = {
|
|||
},
|
||||
|
||||
_blockCommands: function SU__blockCommands() {
|
||||
this._blockedCommands.forEach(function (elt) {
|
||||
this._blockedCommands.forEach(function(elt) {
|
||||
// make sure not to permanently disable this item (see bug 409155)
|
||||
if (elt.hasAttribute("wasDisabled"))
|
||||
return;
|
||||
|
@ -50,7 +50,7 @@ var StarUI = {
|
|||
},
|
||||
|
||||
_restoreCommandsState: function SU__restoreCommandsState() {
|
||||
this._blockedCommands.forEach(function (elt) {
|
||||
this._blockedCommands.forEach(function(elt) {
|
||||
if (elt.getAttribute("wasDisabled") != "true")
|
||||
elt.removeAttribute("disabled");
|
||||
elt.removeAttribute("wasDisabled");
|
||||
|
@ -198,7 +198,7 @@ var StarUI = {
|
|||
this._overlayLoading = true;
|
||||
document.loadOverlay(
|
||||
"chrome://browser/content/places/editBookmarkOverlay.xul",
|
||||
(function (aSubject, aTopic, aData) {
|
||||
(function(aSubject, aTopic, aData) {
|
||||
// Move the header (star, title, button) into the grid,
|
||||
// so that it aligns nicely with the other items (bug 484022).
|
||||
let header = this._element("editBookmarkPanelHeader");
|
||||
|
@ -533,7 +533,7 @@ var PlacesCommandHook = {
|
|||
* @param [optional] aDescription
|
||||
* The linked page description, if available
|
||||
*/
|
||||
bookmarkLink: Task.async(function* (aParentId, aURL, aTitle, aDescription="") {
|
||||
bookmarkLink: Task.async(function* (aParentId, aURL, aTitle, aDescription = "") {
|
||||
let node = yield PlacesUIUtils.fetchNodeLike({ url: aURL });
|
||||
if (node) {
|
||||
PlacesUIUtils.showBookmarkDialog({ action: "edit"
|
||||
|
@ -1144,7 +1144,7 @@ var PlacesToolbarHelper = {
|
|||
return !area || CustomizableUI.TYPE_MENU_PANEL == areaType;
|
||||
},
|
||||
|
||||
onPlaceholderCommand: function () {
|
||||
onPlaceholderCommand: function() {
|
||||
let widgetGroup = CustomizableUI.getWidget("personal-bookmarks");
|
||||
let widget = widgetGroup.forWindow(window);
|
||||
if (widget.overflowed ||
|
||||
|
@ -1903,11 +1903,11 @@ var BookmarkingUI = {
|
|||
}
|
||||
},
|
||||
|
||||
onBeginUpdateBatch: function () {},
|
||||
onEndUpdateBatch: function () {},
|
||||
onBeforeItemRemoved: function () {},
|
||||
onItemVisited: function () {},
|
||||
onItemMoved: function () {},
|
||||
onBeginUpdateBatch: function() {},
|
||||
onEndUpdateBatch: function() {},
|
||||
onBeforeItemRemoved: function() {},
|
||||
onItemVisited: function() {},
|
||||
onItemMoved: function() {},
|
||||
|
||||
// CustomizableUI events:
|
||||
_starButtonLabel: null,
|
||||
|
|
|
@ -17,7 +17,7 @@ var gPluginHandler = {
|
|||
"PluginContent:LinkClickCallback",
|
||||
],
|
||||
|
||||
init: function () {
|
||||
init: function() {
|
||||
const mm = window.messageManager;
|
||||
for (let msg of this.MESSAGES) {
|
||||
mm.addMessageListener(msg, this);
|
||||
|
@ -25,7 +25,7 @@ var gPluginHandler = {
|
|||
window.addEventListener("unload", this);
|
||||
},
|
||||
|
||||
uninit: function () {
|
||||
uninit: function() {
|
||||
const mm = window.messageManager;
|
||||
for (let msg of this.MESSAGES) {
|
||||
mm.removeMessageListener(msg, this);
|
||||
|
@ -33,13 +33,13 @@ var gPluginHandler = {
|
|||
window.removeEventListener("unload", this);
|
||||
},
|
||||
|
||||
handleEvent: function (event) {
|
||||
handleEvent: function(event) {
|
||||
if (event.type == "unload") {
|
||||
this.uninit();
|
||||
}
|
||||
},
|
||||
|
||||
receiveMessage: function (msg) {
|
||||
receiveMessage: function(msg) {
|
||||
switch (msg.name) {
|
||||
case "PluginContent:ShowClickToPlayNotification":
|
||||
this.showClickToPlayNotification(msg.target, msg.data.plugins, msg.data.showNow,
|
||||
|
@ -83,7 +83,7 @@ var gPluginHandler = {
|
|||
},
|
||||
|
||||
// Callback for user clicking on a disabled plugin
|
||||
managePlugins: function () {
|
||||
managePlugins: function() {
|
||||
BrowserOpenAddonsMgr("addons://list/plugin");
|
||||
},
|
||||
|
||||
|
@ -106,12 +106,12 @@ var gPluginHandler = {
|
|||
},
|
||||
|
||||
// Callback for user clicking a "reload page" link
|
||||
reloadPage: function (browser) {
|
||||
reloadPage: function(browser) {
|
||||
browser.reload();
|
||||
},
|
||||
|
||||
// Callback for user clicking the help icon
|
||||
openHelpPage: function () {
|
||||
openHelpPage: function() {
|
||||
openHelpLink("plugin-crashed", false);
|
||||
},
|
||||
|
||||
|
@ -139,7 +139,7 @@ var gPluginHandler = {
|
|||
* and activate plugins if necessary.
|
||||
* aNewState should be either "allownow" "allowalways" or "block"
|
||||
*/
|
||||
_updatePluginPermission: function (aNotification, aPluginInfo, aNewState) {
|
||||
_updatePluginPermission: function(aNotification, aPluginInfo, aNewState) {
|
||||
let permission;
|
||||
let expireType;
|
||||
let expireTime;
|
||||
|
@ -208,8 +208,8 @@ var gPluginHandler = {
|
|||
});
|
||||
},
|
||||
|
||||
showClickToPlayNotification: function (browser, plugins, showNow,
|
||||
principal, location) {
|
||||
showClickToPlayNotification: function(browser, plugins, showNow,
|
||||
principal, location) {
|
||||
// It is possible that we've received a message from the frame script to show
|
||||
// a click to play notification for a principal that no longer matches the one
|
||||
// that the browser's content now has assigned (ie, the browser has browsed away
|
||||
|
@ -289,21 +289,21 @@ var gPluginHandler = {
|
|||
browser.messageManager.sendAsyncMessage("BrowserPlugins:NotificationShown");
|
||||
},
|
||||
|
||||
removeNotification: function (browser, name) {
|
||||
removeNotification: function(browser, name) {
|
||||
let notification = PopupNotifications.getNotification(name, browser);
|
||||
if (notification)
|
||||
PopupNotifications.remove(notification);
|
||||
},
|
||||
|
||||
hideNotificationBar: function (browser, name) {
|
||||
hideNotificationBar: function(browser, name) {
|
||||
let notificationBox = gBrowser.getNotificationBox(browser);
|
||||
let notification = notificationBox.getNotificationWithValue(name);
|
||||
if (notification)
|
||||
notificationBox.removeNotification(notification, true);
|
||||
},
|
||||
|
||||
updateHiddenPluginUI: function (browser, haveInsecure, actions,
|
||||
principal, location) {
|
||||
updateHiddenPluginUI: function(browser, haveInsecure, actions,
|
||||
principal, location) {
|
||||
let origin = principal.originNoSuffix;
|
||||
|
||||
// It is possible that we've received a message from the frame script to show
|
||||
|
@ -436,7 +436,7 @@ var gPluginHandler = {
|
|||
}
|
||||
},
|
||||
|
||||
contextMenuCommand: function (browser, plugin, command) {
|
||||
contextMenuCommand: function(browser, plugin, command) {
|
||||
browser.messageManager.sendAsyncMessage("BrowserPlugins:ContextMenuCommand",
|
||||
{ command: command }, { plugin: plugin });
|
||||
},
|
||||
|
@ -492,7 +492,7 @@ var gPluginHandler = {
|
|||
* For a GMP, this is the pluginID. For NPAPI plugins (where "pluginID"
|
||||
* means something different), this is the runID.
|
||||
*/
|
||||
showPluginCrashedNotification: function (browser, messageString, pluginID) {
|
||||
showPluginCrashedNotification: function(browser, messageString, pluginID) {
|
||||
// If there's already an existing notification bar, don't do anything.
|
||||
let notificationBox = gBrowser.getNotificationBox(browser);
|
||||
let notification = notificationBox.getNotificationWithValue("plugin-crashed");
|
||||
|
|
|
@ -68,7 +68,7 @@ var RefreshBlocker = {
|
|||
let buttons = [{
|
||||
label: refreshButtonText,
|
||||
accessKey: refreshButtonAccesskey,
|
||||
callback: function (notification, button) {
|
||||
callback: function() {
|
||||
if (browser.messageManager) {
|
||||
browser.messageManager.sendAsyncMessage("RefreshBlocker:Refresh", data);
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ var gSyncUI = {
|
|||
_syncStartTime: 0,
|
||||
_syncAnimationTimer: 0,
|
||||
|
||||
init: function () {
|
||||
init: function() {
|
||||
Cu.import("resource://services-common/stringbundle.js");
|
||||
|
||||
// Proceed to set up the UI if Sync has already started up.
|
||||
|
@ -137,7 +137,7 @@ var gSyncUI = {
|
|||
// Note that we don't show login errors in a notification bar here, but do
|
||||
// still need to track a login-failed state so the "Tools" menu updates
|
||||
// with the correct state.
|
||||
_loginFailed: function () {
|
||||
_loginFailed: function() {
|
||||
// If Sync isn't already ready, we don't want to force it to initialize
|
||||
// by referencing Weave.Status - and it isn't going to be accurate before
|
||||
// Sync is ready anyway.
|
||||
|
@ -242,7 +242,7 @@ var gSyncUI = {
|
|||
this.updateUI();
|
||||
},
|
||||
|
||||
_getAppName: function () {
|
||||
_getAppName: function() {
|
||||
let brand = new StringBundle("chrome://branding/locale/brand.properties");
|
||||
return brand.get("brandShortName");
|
||||
},
|
||||
|
@ -304,7 +304,7 @@ var gSyncUI = {
|
|||
},
|
||||
|
||||
// Open the legacy-sync device pairing UI. Note used for FxA Sync.
|
||||
openAddDevice: function () {
|
||||
openAddDevice: function() {
|
||||
if (!Weave.Utils.ensureMPUnlocked())
|
||||
return;
|
||||
|
||||
|
@ -316,11 +316,11 @@ var gSyncUI = {
|
|||
"syncAddDevice", "centerscreen,chrome,resizable=no");
|
||||
},
|
||||
|
||||
openPrefs: function (entryPoint) {
|
||||
openPrefs: function(entryPoint) {
|
||||
openPreferences("paneSync", { urlParams: { entrypoint: entryPoint } });
|
||||
},
|
||||
|
||||
openSignInAgainPage: function (entryPoint = "syncbutton") {
|
||||
openSignInAgainPage: function(entryPoint = "syncbutton") {
|
||||
gFxAccounts.openSignInAgainPage(entryPoint);
|
||||
},
|
||||
|
||||
|
@ -426,10 +426,10 @@ var gSyncUI = {
|
|||
formatLastSyncDate: function(date) {
|
||||
let dateFormat;
|
||||
let sixDaysAgo = (() => {
|
||||
let date = new Date();
|
||||
date.setDate(date.getDate() - 6);
|
||||
date.setHours(0, 0, 0, 0);
|
||||
return date;
|
||||
let tempDate = new Date();
|
||||
tempDate.setDate(tempDate.getDate() - 6);
|
||||
tempDate.setHours(0, 0, 0, 0);
|
||||
return tempDate;
|
||||
})();
|
||||
// It may be confusing for the user to see "Last Sync: Monday" when the last sync was a indeed a Monday but 3 weeks ago
|
||||
if (date < sixDaysAgo) {
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
// don't have CAN_DRAW_IN_TITLEBAR defined.
|
||||
|
||||
var TabsInTitlebar = {
|
||||
init: function () {},
|
||||
uninit: function () {},
|
||||
allowedBy: function (condition, allow) {},
|
||||
init: function() {},
|
||||
uninit: function() {},
|
||||
allowedBy: function(condition, allow) {},
|
||||
updateAppearance: function updateAppearance(aForce) {},
|
||||
get enabled() {
|
||||
return document.documentElement.getAttribute("tabsintitlebar") == "true";
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
// this one on platforms which don't have CAN_DRAW_IN_TITLEBAR defined.
|
||||
|
||||
var TabsInTitlebar = {
|
||||
init: function () {
|
||||
init: function() {
|
||||
if (this._initialized) {
|
||||
return;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ var TabsInTitlebar = {
|
|||
}
|
||||
},
|
||||
|
||||
allowedBy: function (condition, allow) {
|
||||
allowedBy: function(condition, allow) {
|
||||
if (allow) {
|
||||
if (condition in this._disallowed) {
|
||||
delete this._disallowed[condition];
|
||||
|
@ -69,18 +69,18 @@ var TabsInTitlebar = {
|
|||
return document.documentElement.getAttribute("tabsintitlebar") == "true";
|
||||
},
|
||||
|
||||
observe: function (subject, topic, data) {
|
||||
observe: function(subject, topic, data) {
|
||||
if (topic == "nsPref:changed")
|
||||
this._readPref();
|
||||
},
|
||||
|
||||
handleEvent: function (aEvent) {
|
||||
handleEvent: function(aEvent) {
|
||||
if (aEvent.type == "resolutionchange" && aEvent.target == window) {
|
||||
this._update(true);
|
||||
}
|
||||
},
|
||||
|
||||
_onMenuMutate: function (aMutations) {
|
||||
_onMenuMutate: function(aMutations) {
|
||||
for (let mutation of aMutations) {
|
||||
if (mutation.attributeName == "inactive" ||
|
||||
mutation.attributeName == "autohide") {
|
||||
|
@ -96,12 +96,12 @@ var TabsInTitlebar = {
|
|||
_prefName: "browser.tabs.drawInTitlebar",
|
||||
_lastSizeMode: null,
|
||||
|
||||
_readPref: function () {
|
||||
_readPref: function() {
|
||||
this.allowedBy("pref",
|
||||
Services.prefs.getBoolPref(this._prefName));
|
||||
},
|
||||
|
||||
_update: function (aForce=false) {
|
||||
_update: function(aForce = false) {
|
||||
let $ = id => document.getElementById(id);
|
||||
let rect = ele => ele.getBoundingClientRect();
|
||||
let verticalMargins = cstyle => parseFloat(cstyle.marginBottom) + parseFloat(cstyle.marginTop);
|
||||
|
@ -253,12 +253,12 @@ var TabsInTitlebar = {
|
|||
}
|
||||
},
|
||||
|
||||
_sizePlaceholder: function (type, width) {
|
||||
Array.forEach(document.querySelectorAll(".titlebar-placeholder[type='"+ type +"']"),
|
||||
function (node) { node.width = width; });
|
||||
_sizePlaceholder: function(type, width) {
|
||||
Array.forEach(document.querySelectorAll(".titlebar-placeholder[type='" + type + "']"),
|
||||
function(node) { node.width = width; });
|
||||
},
|
||||
|
||||
uninit: function () {
|
||||
uninit: function() {
|
||||
this._initialized = false;
|
||||
removeEventListener("resolutionchange", this);
|
||||
Services.prefs.removeObserver(this._prefName, this);
|
||||
|
|
|
@ -36,7 +36,7 @@ var gBrowserThumbnails = {
|
|||
this._sslDiskCacheEnabled =
|
||||
Services.prefs.getBoolPref(this.PREF_DISK_CACHE_SSL);
|
||||
|
||||
this._tabEvents.forEach(function (aEvent) {
|
||||
this._tabEvents.forEach(function(aEvent) {
|
||||
gBrowser.tabContainer.addEventListener(aEvent, this, false);
|
||||
}, this);
|
||||
|
||||
|
@ -48,7 +48,7 @@ var gBrowserThumbnails = {
|
|||
gBrowser.removeTabsProgressListener(this);
|
||||
Services.prefs.removeObserver(this.PREF_DISK_CACHE_SSL, this);
|
||||
|
||||
this._tabEvents.forEach(function (aEvent) {
|
||||
this._tabEvents.forEach(function(aEvent) {
|
||||
gBrowser.tabContainer.removeEventListener(aEvent, this, false);
|
||||
}, this);
|
||||
},
|
||||
|
@ -94,7 +94,7 @@ var gBrowserThumbnails = {
|
|||
// Only capture about:newtab top sites.
|
||||
if (this._topSiteURLs.indexOf(aBrowser.currentURI.spec) == -1)
|
||||
return;
|
||||
this._shouldCapture(aBrowser, function (aResult) {
|
||||
this._shouldCapture(aBrowser, function(aResult) {
|
||||
if (aResult) {
|
||||
PageThumbs.captureAndStoreIfStale(aBrowser);
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ var gBrowserThumbnails = {
|
|||
else
|
||||
aBrowser.addEventListener("scroll", this, true);
|
||||
|
||||
let timeout = setTimeout(function () {
|
||||
let timeout = setTimeout(function() {
|
||||
this._clearTimeout(aBrowser);
|
||||
this._capture(aBrowser);
|
||||
}.bind(this), this._captureDelayMS);
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -83,7 +83,7 @@ addEventListener("blur", function(event) {
|
|||
LoginManagerContent.onUsernameInput(event);
|
||||
});
|
||||
|
||||
var handleContentContextMenu = function (event) {
|
||||
var handleContentContextMenu = function(event) {
|
||||
let defaultPrevented = event.defaultPrevented;
|
||||
if (!Services.prefs.getBoolPref("dom.event.contextmenu.enabled")) {
|
||||
let plugin = null;
|
||||
|
@ -360,7 +360,7 @@ var AboutNetAndCertErrorListener = {
|
|||
}
|
||||
},
|
||||
|
||||
changedCertPrefs: function () {
|
||||
changedCertPrefs: function() {
|
||||
for (let prefName of PREF_SSL_IMPACT) {
|
||||
if (Services.prefs.prefHasUserValue(prefName)) {
|
||||
return true;
|
||||
|
@ -519,7 +519,7 @@ var ClickEventHandler = {
|
|||
}
|
||||
},
|
||||
|
||||
onCertError: function (targetElement, ownerDoc) {
|
||||
onCertError: function(targetElement, ownerDoc) {
|
||||
let docShell = ownerDoc.defaultView.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShell);
|
||||
|
@ -531,7 +531,7 @@ var ClickEventHandler = {
|
|||
});
|
||||
},
|
||||
|
||||
onAboutBlocked: function (targetElement, ownerDoc) {
|
||||
onAboutBlocked: function(targetElement, ownerDoc) {
|
||||
var reason = 'phishing';
|
||||
if (/e=malwareBlocked/.test(ownerDoc.documentURI)) {
|
||||
reason = 'malware';
|
||||
|
@ -546,7 +546,7 @@ var ClickEventHandler = {
|
|||
});
|
||||
},
|
||||
|
||||
onAboutNetError: function (event, documentURI) {
|
||||
onAboutNetError: function(event, documentURI) {
|
||||
let elmId = event.originalTarget.getAttribute("id");
|
||||
if (elmId == "returnButton") {
|
||||
sendAsyncMessage("Browser:SSLErrorGoBack", {});
|
||||
|
@ -683,7 +683,7 @@ var PageMetadataMessenger = {
|
|||
}
|
||||
PageMetadataMessenger.init();
|
||||
|
||||
addEventListener("ActivateSocialFeature", function (aEvent) {
|
||||
addEventListener("ActivateSocialFeature", function(aEvent) {
|
||||
let document = content.document;
|
||||
let dwu = content.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindowUtils);
|
||||
|
@ -835,7 +835,7 @@ addMessageListener("ContextMenu:SearchFieldBookmarkData", (message) => {
|
|||
((type == "checkbox" || type == "radio") && el.checked)) {
|
||||
formData.push(escapeNameValuePair(el.name, el.value, isURLEncoded));
|
||||
} else if (el instanceof content.HTMLSelectElement && el.selectedIndex >= 0) {
|
||||
for (let j=0; j < el.options.length; j++) {
|
||||
for (let j = 0; j < el.options.length; j++) {
|
||||
if (el.options[j].selected)
|
||||
formData.push(escapeNameValuePair(el.name, el.options[j].value,
|
||||
isURLEncoded));
|
||||
|
@ -873,7 +873,7 @@ var LightWeightThemeWebInstallListener = {
|
|||
addEventListener("ResetBrowserThemePreview", this, false, true);
|
||||
},
|
||||
|
||||
handleEvent: function (event) {
|
||||
handleEvent: function(event) {
|
||||
switch (event.type) {
|
||||
case "InstallBrowserTheme": {
|
||||
sendAsyncMessage("LightWeightThemeWebInstaller:Install", {
|
||||
|
@ -907,7 +907,7 @@ var LightWeightThemeWebInstallListener = {
|
|||
}
|
||||
},
|
||||
|
||||
_resetPreviewWindow: function () {
|
||||
_resetPreviewWindow: function() {
|
||||
this._previewWindow.removeEventListener("pagehide", this, true);
|
||||
this._previewWindow = null;
|
||||
}
|
||||
|
@ -1147,8 +1147,8 @@ var PageInfoListener = {
|
|||
// multiple background images.
|
||||
let mediaItems = [];
|
||||
|
||||
let addImage = (url, type, alt, elem, isBg) => {
|
||||
let element = this.serializeElementInfo(document, url, type, alt, elem, isBg);
|
||||
let addImage = (url, type, alt, el, isBg) => {
|
||||
let element = this.serializeElementInfo(document, url, type, alt, el, isBg);
|
||||
mediaItems.push([url, type, alt, element, isBg]);
|
||||
};
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
this.ContentSearchUIController = (function () {
|
||||
this.ContentSearchUIController = (function() {
|
||||
|
||||
const MAX_DISPLAYED_SUGGESTIONS = 6;
|
||||
const SUGGESTION_ID_PREFIX = "searchSuggestion";
|
||||
|
@ -38,7 +38,7 @@ const HTML_NS = "http://www.w3.org/1999/xhtml";
|
|||
* string.
|
||||
*/
|
||||
function ContentSearchUIController(inputElement, tableParent, healthReportKey,
|
||||
searchPurpose, idPrefix="") {
|
||||
searchPurpose, idPrefix = "") {
|
||||
this.input = inputElement;
|
||||
this._idPrefix = idPrefix;
|
||||
this._healthReportKey = healthReportKey;
|
||||
|
@ -193,7 +193,7 @@ ContentSearchUIController.prototype = {
|
|||
return this._suggestionsList.children.length;
|
||||
},
|
||||
|
||||
selectAndUpdateInput: function (idx) {
|
||||
selectAndUpdateInput: function(idx) {
|
||||
this.selectedIndex = idx;
|
||||
let newValue = this.suggestionAtIndex(idx) || this._stickyInputValue;
|
||||
// Setting the input value when the value has not changed commits the current
|
||||
|
@ -204,12 +204,12 @@ ContentSearchUIController.prototype = {
|
|||
this._updateSearchWithHeader();
|
||||
},
|
||||
|
||||
suggestionAtIndex: function (idx) {
|
||||
suggestionAtIndex: function(idx) {
|
||||
let row = this._suggestionsList.children[idx];
|
||||
return row ? row.textContent : null;
|
||||
},
|
||||
|
||||
deleteSuggestionAtIndex: function (idx) {
|
||||
deleteSuggestionAtIndex: function(idx) {
|
||||
// Only form history suggestions can be deleted.
|
||||
if (this.isFormHistorySuggestionAtIndex(idx)) {
|
||||
let suggestionStr = this.suggestionAtIndex(idx);
|
||||
|
@ -219,16 +219,16 @@ ContentSearchUIController.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
isFormHistorySuggestionAtIndex: function (idx) {
|
||||
isFormHistorySuggestionAtIndex: function(idx) {
|
||||
let row = this._suggestionsList.children[idx];
|
||||
return row && row.classList.contains("formHistory");
|
||||
},
|
||||
|
||||
addInputValueToFormHistory: function () {
|
||||
addInputValueToFormHistory: function() {
|
||||
this._sendMsg("AddFormHistoryEntry", this.input.value);
|
||||
},
|
||||
|
||||
handleEvent: function (event) {
|
||||
handleEvent: function(event) {
|
||||
this["_on" + event.type[0].toUpperCase() + event.type.substr(1)](event);
|
||||
},
|
||||
|
||||
|
@ -246,7 +246,7 @@ ContentSearchUIController.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
search: function (aEvent) {
|
||||
search: function(aEvent) {
|
||||
if (!this.defaultEngine) {
|
||||
return; // Not initialized yet.
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ ContentSearchUIController.prototype = {
|
|||
this.addInputValueToFormHistory();
|
||||
},
|
||||
|
||||
_onInput: function () {
|
||||
_onInput: function() {
|
||||
if (!this.input.value) {
|
||||
this._stickyInputValue = "";
|
||||
this._hideSuggestions();
|
||||
|
@ -308,7 +308,7 @@ ContentSearchUIController.prototype = {
|
|||
this._updateSearchWithHeader();
|
||||
},
|
||||
|
||||
_onKeypress: function (event) {
|
||||
_onKeypress: function(event) {
|
||||
let selectedIndexDelta = 0;
|
||||
let selectedSuggestionDelta = 0;
|
||||
let selectedOneOffDelta = 0;
|
||||
|
@ -455,7 +455,7 @@ ContentSearchUIController.prototype = {
|
|||
},
|
||||
|
||||
_currentEngineIndex: -1,
|
||||
_cycleCurrentEngine: function (aReverse) {
|
||||
_cycleCurrentEngine: function(aReverse) {
|
||||
if ((this._currentEngineIndex == this._engines.length - 1 && !aReverse) ||
|
||||
(this._currentEngineIndex == 0 && aReverse)) {
|
||||
return;
|
||||
|
@ -465,7 +465,7 @@ ContentSearchUIController.prototype = {
|
|||
this._sendMsg("SetCurrentEngine", engineName);
|
||||
},
|
||||
|
||||
_onFocus: function () {
|
||||
_onFocus: function() {
|
||||
if (this._mousedown) {
|
||||
return;
|
||||
}
|
||||
|
@ -478,7 +478,7 @@ ContentSearchUIController.prototype = {
|
|||
this._speculativeConnect();
|
||||
},
|
||||
|
||||
_onBlur: function () {
|
||||
_onBlur: function() {
|
||||
if (this._mousedown) {
|
||||
// At this point, this.input has lost focus, but a new element has not yet
|
||||
// received it. If we re-focus this.input directly, the new element will
|
||||
|
@ -490,7 +490,7 @@ ContentSearchUIController.prototype = {
|
|||
this._hideSuggestions();
|
||||
},
|
||||
|
||||
_onMousemove: function (event) {
|
||||
_onMousemove: function(event) {
|
||||
let idx = this._indexOfTableItem(event.target);
|
||||
if (idx >= this.numSuggestions) {
|
||||
this.selectedButtonIndex = idx - this.numSuggestions;
|
||||
|
@ -499,14 +499,14 @@ ContentSearchUIController.prototype = {
|
|||
this.selectedIndex = idx;
|
||||
},
|
||||
|
||||
_onMouseup: function (event) {
|
||||
_onMouseup: function(event) {
|
||||
if (event.button == 2) {
|
||||
return;
|
||||
}
|
||||
this._onCommand(event);
|
||||
},
|
||||
|
||||
_onMouseout: function (event) {
|
||||
_onMouseout: function(event) {
|
||||
// We only deselect one-off buttons and the settings button when they are
|
||||
// moused out.
|
||||
let idx = this._indexOfTableItem(event.originalTarget);
|
||||
|
@ -515,22 +515,22 @@ ContentSearchUIController.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
_onClick: function (event) {
|
||||
_onClick: function(event) {
|
||||
this._onMouseup(event);
|
||||
},
|
||||
|
||||
_onContentSearchService: function (event) {
|
||||
_onContentSearchService: function(event) {
|
||||
let methodName = "_onMsg" + event.detail.type;
|
||||
if (methodName in this) {
|
||||
this[methodName](event.detail.data);
|
||||
}
|
||||
},
|
||||
|
||||
_onMsgFocusInput: function (event) {
|
||||
_onMsgFocusInput: function(event) {
|
||||
this.input.focus();
|
||||
},
|
||||
|
||||
_onMsgSuggestions: function (suggestions) {
|
||||
_onMsgSuggestions: function(suggestions) {
|
||||
// Ignore the suggestions if their search string or engine doesn't match
|
||||
// ours. Due to the async nature of message passing, this can easily happen
|
||||
// when the user types quickly.
|
||||
|
@ -585,13 +585,13 @@ ContentSearchUIController.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
_onMsgSuggestionsCancelled: function () {
|
||||
_onMsgSuggestionsCancelled: function() {
|
||||
if (!this._table.hidden) {
|
||||
this._hideSuggestions();
|
||||
}
|
||||
},
|
||||
|
||||
_onMsgState: function (state) {
|
||||
_onMsgState: function(state) {
|
||||
this.engines = state.engines;
|
||||
// No point updating the default engine (and the header) if there's no change.
|
||||
if (this.defaultEngine &&
|
||||
|
@ -602,16 +602,16 @@ ContentSearchUIController.prototype = {
|
|||
this.defaultEngine = state.currentEngine;
|
||||
},
|
||||
|
||||
_onMsgCurrentState: function (state) {
|
||||
_onMsgCurrentState: function(state) {
|
||||
this._onMsgState(state);
|
||||
},
|
||||
|
||||
_onMsgCurrentEngine: function (engine) {
|
||||
_onMsgCurrentEngine: function(engine) {
|
||||
this.defaultEngine = engine;
|
||||
this._pendingOneOffRefresh = true;
|
||||
},
|
||||
|
||||
_onMsgStrings: function (strings) {
|
||||
_onMsgStrings: function(strings) {
|
||||
this._strings = strings;
|
||||
this._updateDefaultEngineHeader();
|
||||
this._updateSearchWithHeader();
|
||||
|
@ -620,7 +620,7 @@ ContentSearchUIController.prototype = {
|
|||
this.input.setAttribute("placeholder", this._strings.searchPlaceholder);
|
||||
},
|
||||
|
||||
_updateDefaultEngineHeader: function () {
|
||||
_updateDefaultEngineHeader: function() {
|
||||
let header = document.getElementById("contentSearchDefaultEngineHeader");
|
||||
header.firstChild.setAttribute("src", this.defaultEngine.icon);
|
||||
if (!this._strings) {
|
||||
|
@ -633,7 +633,7 @@ ContentSearchUIController.prototype = {
|
|||
this._strings.searchHeader.replace("%S", this.defaultEngine.name)));
|
||||
},
|
||||
|
||||
_updateSearchWithHeader: function () {
|
||||
_updateSearchWithHeader: function() {
|
||||
if (!this._strings) {
|
||||
return;
|
||||
}
|
||||
|
@ -646,13 +646,13 @@ ContentSearchUIController.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
_speculativeConnect: function () {
|
||||
_speculativeConnect: function() {
|
||||
if (this.defaultEngine) {
|
||||
this._sendMsg("SpeculativeConnect", this.defaultEngine.name);
|
||||
}
|
||||
},
|
||||
|
||||
_makeTableRow: function (type, suggestionStr, currentRow, searchWords) {
|
||||
_makeTableRow: function(type, suggestionStr, currentRow, searchWords) {
|
||||
let row = document.createElementNS(HTML_NS, "tr");
|
||||
row.dir = "auto";
|
||||
row.classList.add("contentSearchSuggestionRow");
|
||||
|
@ -689,28 +689,28 @@ ContentSearchUIController.prototype = {
|
|||
},
|
||||
|
||||
// Converts favicon array buffer into a data URI.
|
||||
_getFaviconURIFromBuffer: function (buffer) {
|
||||
_getFaviconURIFromBuffer: function(buffer) {
|
||||
let blob = new Blob([buffer]);
|
||||
return URL.createObjectURL(blob);
|
||||
},
|
||||
|
||||
// Adds "@2x" to the name of the given PNG url for "retina" screens.
|
||||
_getImageURIForCurrentResolution: function (uri) {
|
||||
_getImageURIForCurrentResolution: function(uri) {
|
||||
if (window.devicePixelRatio > 1) {
|
||||
return uri.replace(/\.png$/, "@2x.png");
|
||||
}
|
||||
return uri;
|
||||
},
|
||||
|
||||
_getSearchEngines: function () {
|
||||
_getSearchEngines: function() {
|
||||
this._sendMsg("GetState");
|
||||
},
|
||||
|
||||
_getStrings: function () {
|
||||
_getStrings: function() {
|
||||
this._sendMsg("GetStrings");
|
||||
},
|
||||
|
||||
_getSuggestions: function () {
|
||||
_getSuggestions: function() {
|
||||
this._stickyInputValue = this.input.value;
|
||||
if (this.defaultEngine) {
|
||||
this._sendMsg("GetSuggestions", {
|
||||
|
@ -727,7 +727,7 @@ ContentSearchUIController.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
_hideSuggestions: function () {
|
||||
_hideSuggestions: function() {
|
||||
this.input.setAttribute("aria-expanded", "false");
|
||||
this.selectedIndex = -1;
|
||||
this.selectedButtonIndex = -1;
|
||||
|
@ -735,7 +735,7 @@ ContentSearchUIController.prototype = {
|
|||
this._table.hidden = true;
|
||||
},
|
||||
|
||||
_indexOfTableItem: function (elt) {
|
||||
_indexOfTableItem: function(elt) {
|
||||
if (elt.classList.contains("contentSearchOneOffItem")) {
|
||||
return this.numSuggestions + this._oneOffButtons.indexOf(elt);
|
||||
}
|
||||
|
@ -751,7 +751,7 @@ ContentSearchUIController.prototype = {
|
|||
return elt.rowIndex;
|
||||
},
|
||||
|
||||
_makeTable: function (id) {
|
||||
_makeTable: function(id) {
|
||||
this._table = document.createElementNS(HTML_NS, "table");
|
||||
this._table.id = id;
|
||||
this._table.hidden = true;
|
||||
|
@ -820,7 +820,7 @@ ContentSearchUIController.prototype = {
|
|||
return this._table;
|
||||
},
|
||||
|
||||
_setUpOneOffButtons: function () {
|
||||
_setUpOneOffButtons: function() {
|
||||
// Sometimes we receive a CurrentEngine message from the ContentSearch service
|
||||
// before we've received a State message - i.e. before we have our engines.
|
||||
if (!this._engines) {
|
||||
|
@ -901,7 +901,7 @@ ContentSearchUIController.prototype = {
|
|||
this._oneOffsTable.hidden = false;
|
||||
},
|
||||
|
||||
_sendMsg: function (type, data=null) {
|
||||
_sendMsg: function(type, data = null) {
|
||||
dispatchEvent(new CustomEvent("ContentSearchClient", {
|
||||
detail: {
|
||||
type: type,
|
||||
|
|
|
@ -725,9 +725,9 @@ function saveMedia()
|
|||
var tree = document.getElementById("imagetree");
|
||||
var rowArray = getSelectedRows(tree);
|
||||
if (rowArray.length == 1) {
|
||||
var row = rowArray[0];
|
||||
var item = gImageView.data[row][COL_IMAGE_NODE];
|
||||
var url = gImageView.data[row][COL_IMAGE_ADDRESS];
|
||||
let row = rowArray[0];
|
||||
let item = gImageView.data[row][COL_IMAGE_NODE];
|
||||
let url = gImageView.data[row][COL_IMAGE_ADDRESS];
|
||||
|
||||
if (url) {
|
||||
var titleKey = "SaveImageTitle";
|
||||
|
@ -750,11 +750,11 @@ function saveMedia()
|
|||
};
|
||||
|
||||
for (var i = 0; i < rowArray.length; i++) {
|
||||
var v = rowArray[i];
|
||||
var dir = aDirectory.clone();
|
||||
var item = gImageView.data[v][COL_IMAGE_NODE];
|
||||
var uriString = gImageView.data[v][COL_IMAGE_ADDRESS];
|
||||
var uri = makeURI(uriString);
|
||||
let v = rowArray[i];
|
||||
let dir = aDirectory.clone();
|
||||
let item = gImageView.data[v][COL_IMAGE_NODE];
|
||||
let uriString = gImageView.data[v][COL_IMAGE_ADDRESS];
|
||||
let uri = makeURI(uriString);
|
||||
|
||||
try {
|
||||
uri.QueryInterface(Components.interfaces.nsIURL);
|
||||
|
@ -1004,7 +1004,7 @@ function makeBlockImage(url)
|
|||
}
|
||||
|
||||
var imagePermissionObserver = {
|
||||
observe: function (aSubject, aTopic, aData)
|
||||
observe: function(aSubject, aTopic, aData)
|
||||
{
|
||||
if (document.getElementById("mediaPreviewBox").collapsed)
|
||||
return;
|
||||
|
|
|
@ -15,7 +15,7 @@ var gPermissions = SitePermissions.listPermissions();
|
|||
gPermissions.push("plugins");
|
||||
|
||||
var permissionObserver = {
|
||||
observe: function (aSubject, aTopic, aData)
|
||||
observe: function(aSubject, aTopic, aData)
|
||||
{
|
||||
if (aTopic == "perm-changed") {
|
||||
var permission = aSubject.QueryInterface(Components.interfaces.nsIPermission);
|
||||
|
|
|
@ -15,7 +15,7 @@ var security = {
|
|||
},
|
||||
|
||||
// Display the server certificate (static)
|
||||
viewCert : function () {
|
||||
viewCert : function() {
|
||||
var cert = security._cert;
|
||||
viewCertHelper(window, cert);
|
||||
},
|
||||
|
|
|
@ -38,14 +38,14 @@ function Sanitizer() {
|
|||
}
|
||||
Sanitizer.prototype = {
|
||||
// warning to the caller: this one may raise an exception (e.g. bug #265028)
|
||||
clearItem: function (aItemName)
|
||||
clearItem: function(aItemName)
|
||||
{
|
||||
this.items[aItemName].clear();
|
||||
},
|
||||
|
||||
prefDomain: "",
|
||||
|
||||
getNameFromPreference: function (aPreferenceName)
|
||||
getNameFromPreference: function(aPreferenceName)
|
||||
{
|
||||
return aPreferenceName.substr(this.prefDomain.length);
|
||||
},
|
||||
|
@ -731,7 +731,7 @@ Sanitizer.TIMESPAN_24HOURS = 6;
|
|||
// in the uSec-since-epoch format that PRTime likes. If we should
|
||||
// clear everything, return null. Use ts if it is defined; otherwise
|
||||
// use the timeSpan pref.
|
||||
Sanitizer.getClearRange = function (ts) {
|
||||
Sanitizer.getClearRange = function(ts) {
|
||||
if (ts === undefined)
|
||||
ts = Sanitizer.prefs.getIntPref("timeSpan");
|
||||
if (ts === Sanitizer.TIMESPAN_EVERYTHING)
|
||||
|
@ -781,7 +781,7 @@ Sanitizer.__defineGetter__("prefs", function()
|
|||
Sanitizer.showUI = function(aParentWindow)
|
||||
{
|
||||
let win = AppConstants.platform == "macosx" ?
|
||||
null: // make this an app-modal window on Mac
|
||||
null : // make this an app-modal window on Mac
|
||||
aParentWindow;
|
||||
Services.ww.openWindow(win,
|
||||
"chrome://browser/content/sanitize.xul",
|
||||
|
|
|
@ -23,7 +23,7 @@ if (AppConstants.MOZ_SERVICES_CLOUDSYNC) {
|
|||
var RemoteTabViewer = {
|
||||
_tabsList: null,
|
||||
|
||||
init: function () {
|
||||
init: function() {
|
||||
Services.obs.addObserver(this, "weave:service:login:finish", false);
|
||||
Services.obs.addObserver(this, "weave:engine:sync:finish", false);
|
||||
|
||||
|
@ -34,14 +34,14 @@ var RemoteTabViewer = {
|
|||
this.buildList(true);
|
||||
},
|
||||
|
||||
uninit: function () {
|
||||
uninit: function() {
|
||||
Services.obs.removeObserver(this, "weave:service:login:finish");
|
||||
Services.obs.removeObserver(this, "weave:engine:sync:finish");
|
||||
|
||||
Services.obs.removeObserver(this, "cloudsync:tabs:update");
|
||||
},
|
||||
|
||||
createItem: function (attrs) {
|
||||
createItem: function(attrs) {
|
||||
let item = document.createElement("richlistitem");
|
||||
|
||||
// Copy the attributes from the argument into the item.
|
||||
|
@ -56,7 +56,7 @@ var RemoteTabViewer = {
|
|||
return item;
|
||||
},
|
||||
|
||||
filterTabs: function (event) {
|
||||
filterTabs: function(event) {
|
||||
let val = event.target.value.toLowerCase();
|
||||
let numTabs = this._tabsList.getRowCount();
|
||||
let clientTabs = 0;
|
||||
|
@ -89,7 +89,7 @@ var RemoteTabViewer = {
|
|||
}
|
||||
},
|
||||
|
||||
openSelected: function () {
|
||||
openSelected: function() {
|
||||
let items = this._tabsList.selectedItems;
|
||||
let urls = [];
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
|
@ -105,7 +105,7 @@ var RemoteTabViewer = {
|
|||
}
|
||||
},
|
||||
|
||||
bookmarkSingleTab: function () {
|
||||
bookmarkSingleTab: function() {
|
||||
let item = this._tabsList.selectedItems[0];
|
||||
let uri = Weave.Utils.makeURI(item.getAttribute("url"));
|
||||
let title = item.getAttribute("title");
|
||||
|
@ -120,7 +120,7 @@ var RemoteTabViewer = {
|
|||
}, window.top);
|
||||
},
|
||||
|
||||
bookmarkSelectedTabs: function () {
|
||||
bookmarkSelectedTabs: function() {
|
||||
let items = this._tabsList.selectedItems;
|
||||
let URIs = [];
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
|
@ -142,7 +142,7 @@ var RemoteTabViewer = {
|
|||
}
|
||||
},
|
||||
|
||||
getIcon: function (iconUri, defaultIcon) {
|
||||
getIcon: function(iconUri, defaultIcon) {
|
||||
try {
|
||||
let iconURI = Weave.Utils.makeURI(iconUri);
|
||||
return PlacesUtils.favicons.getFaviconLinkForIcon(iconURI).spec;
|
||||
|
@ -158,7 +158,7 @@ var RemoteTabViewer = {
|
|||
|
||||
_buildListRequested: false,
|
||||
|
||||
buildList: function (forceSync) {
|
||||
buildList: function(forceSync) {
|
||||
if (this._waitingForBuildList) {
|
||||
this._buildListRequested = true;
|
||||
return;
|
||||
|
@ -192,7 +192,7 @@ var RemoteTabViewer = {
|
|||
}
|
||||
},
|
||||
|
||||
_clearTabList: function () {
|
||||
_clearTabList: function() {
|
||||
let list = this._tabsList;
|
||||
|
||||
// Clear out existing richlistitems.
|
||||
|
@ -204,7 +204,7 @@ var RemoteTabViewer = {
|
|||
}
|
||||
},
|
||||
|
||||
_generateWeaveTabList: function () {
|
||||
_generateWeaveTabList: function() {
|
||||
let engine = Weave.Service.engineManager.get("tabs");
|
||||
let list = this._tabsList;
|
||||
|
||||
|
@ -245,8 +245,8 @@ var RemoteTabViewer = {
|
|||
}
|
||||
},
|
||||
|
||||
_generateCloudSyncTabList: function () {
|
||||
let updateTabList = function (remoteTabs) {
|
||||
_generateCloudSyncTabList: function() {
|
||||
let updateTabList = function(remoteTabs) {
|
||||
let list = this._tabsList;
|
||||
|
||||
for (let client of remoteTabs) {
|
||||
|
@ -275,7 +275,7 @@ var RemoteTabViewer = {
|
|||
.then(updateTabList, Promise.reject.bind(Promise));
|
||||
},
|
||||
|
||||
adjustContextMenu: function (event) {
|
||||
adjustContextMenu: function(event) {
|
||||
let mode = "all";
|
||||
switch (this._tabsList.selectedItems.length) {
|
||||
case 0:
|
||||
|
@ -300,7 +300,7 @@ var RemoteTabViewer = {
|
|||
}
|
||||
},
|
||||
|
||||
_refetchTabs: function (force) {
|
||||
_refetchTabs: function(force) {
|
||||
if (!force) {
|
||||
// Don't bother refetching tabs if we already did so recently
|
||||
let lastFetch = 0;
|
||||
|
@ -325,7 +325,7 @@ var RemoteTabViewer = {
|
|||
return true;
|
||||
},
|
||||
|
||||
observe: function (subject, topic, data) {
|
||||
observe: function(subject, topic, data) {
|
||||
switch (topic) {
|
||||
case "weave:service:login:finish":
|
||||
// A login has finished, which means that a Sync is about to start and
|
||||
|
@ -346,7 +346,7 @@ var RemoteTabViewer = {
|
|||
}
|
||||
},
|
||||
|
||||
handleClick: function (event) {
|
||||
handleClick: function(event) {
|
||||
if (event.target.getAttribute("type") != "tab") {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ var gSyncAddDevice = {
|
|||
};
|
||||
// onWizardAdvance() and onPageShow() are run before init() so we'll set
|
||||
// these up as lazy getters.
|
||||
["wizard", "pin1", "pin2", "pin3"].forEach(function (id) {
|
||||
["wizard", "pin1", "pin2", "pin3"].forEach(function(id) {
|
||||
XPCOMUtils.defineLazyGetter(gSyncAddDevice, id, function() {
|
||||
return document.getElementById(id);
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
addEventListener("dialogaccept", function () {
|
||||
addEventListener("dialogaccept", function() {
|
||||
let pane = document.getElementById("sync-customize-pane");
|
||||
// First determine what the preference for the "global" sync enabled pref
|
||||
// should be based on the engines selected.
|
||||
|
|
|
@ -147,7 +147,7 @@ var Change = {
|
|||
return undefined;
|
||||
},
|
||||
|
||||
doGeneratePassphrase: function () {
|
||||
doGeneratePassphrase: function() {
|
||||
let passphrase = Weave.Utils.generatePassphrase();
|
||||
this._passphraseBox.value = Weave.Utils.hyphenatePassphrase(passphrase);
|
||||
this._dialog.getButton("finish").disabled = false;
|
||||
|
@ -201,7 +201,7 @@ var Change = {
|
|||
return false;
|
||||
},
|
||||
|
||||
validate: function (event) {
|
||||
validate: function(event) {
|
||||
let valid = false;
|
||||
let errorString = "";
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ var gSyncSetup = {
|
|||
return document.getElementById("existingServer").selectedIndex == 0;
|
||||
},
|
||||
|
||||
init: function () {
|
||||
init: function() {
|
||||
let obs = [
|
||||
["weave:service:change-passphrase", "onResetPassphrase"],
|
||||
["weave:service:login:start", "onLoginStart"],
|
||||
|
@ -83,7 +83,7 @@ var gSyncSetup = {
|
|||
addRem(true);
|
||||
window.addEventListener("unload", () => addRem(false), false);
|
||||
|
||||
window.setTimeout(function () {
|
||||
window.setTimeout(function() {
|
||||
// Force Service to be loaded so that engines are registered.
|
||||
// See Bug 670082.
|
||||
Weave.Service;
|
||||
|
@ -121,14 +121,14 @@ var gSyncSetup = {
|
|||
.getAttribute("accesskey");
|
||||
},
|
||||
|
||||
startNewAccountSetup: function () {
|
||||
startNewAccountSetup: function() {
|
||||
if (!Weave.Utils.ensureMPUnlocked())
|
||||
return;
|
||||
this._settingUpNew = true;
|
||||
this.wizard.pageIndex = NEW_ACCOUNT_START_PAGE;
|
||||
},
|
||||
|
||||
useExistingAccount: function () {
|
||||
useExistingAccount: function() {
|
||||
if (!Weave.Utils.ensureMPUnlocked())
|
||||
return;
|
||||
this._settingUpNew = false;
|
||||
|
@ -173,22 +173,22 @@ var gSyncSetup = {
|
|||
gSyncUtils.resetPassphrase(true);
|
||||
},
|
||||
|
||||
onResetPassphrase: function () {
|
||||
onResetPassphrase: function() {
|
||||
document.getElementById("existingPassphrase").value =
|
||||
Weave.Utils.hyphenatePassphrase(Weave.Service.identity.syncKey);
|
||||
this.checkFields();
|
||||
this.wizard.advance();
|
||||
},
|
||||
|
||||
onLoginStart: function () {
|
||||
onLoginStart: function() {
|
||||
this.toggleLoginFeedback(false);
|
||||
},
|
||||
|
||||
onLoginEnd: function () {
|
||||
onLoginEnd: function() {
|
||||
this.toggleLoginFeedback(true);
|
||||
},
|
||||
|
||||
sendCredentialsAfterSync: function () {
|
||||
sendCredentialsAfterSync: function() {
|
||||
let send = function() {
|
||||
Services.obs.removeObserver("weave:service:sync:finish", send);
|
||||
Services.obs.removeObserver("weave:service:sync:error", send);
|
||||
|
@ -202,7 +202,7 @@ var gSyncSetup = {
|
|||
Services.obs.addObserver("weave:service:sync:error", send, false);
|
||||
},
|
||||
|
||||
toggleLoginFeedback: function (stop) {
|
||||
toggleLoginFeedback: function(stop) {
|
||||
document.getElementById("login-throbber").hidden = stop;
|
||||
let password = document.getElementById("existingPasswordFeedbackRow");
|
||||
let server = document.getElementById("existingServerFeedbackRow");
|
||||
|
@ -231,7 +231,7 @@ var gSyncSetup = {
|
|||
this._setFeedbackMessage(feedback, false, Weave.Status.login);
|
||||
},
|
||||
|
||||
setupInitialSync: function () {
|
||||
setupInitialSync: function() {
|
||||
let action = document.getElementById("mergeChoiceRadio").selectedItem.id;
|
||||
switch (action) {
|
||||
case "resetClient":
|
||||
|
@ -248,11 +248,11 @@ var gSyncSetup = {
|
|||
},
|
||||
|
||||
// fun with validation!
|
||||
checkFields: function () {
|
||||
checkFields: function() {
|
||||
this.wizard.canAdvance = this.readyToAdvance();
|
||||
},
|
||||
|
||||
readyToAdvance: function () {
|
||||
readyToAdvance: function() {
|
||||
switch (this.wizard.pageIndex) {
|
||||
case INTRO_PAGE:
|
||||
return false;
|
||||
|
@ -293,11 +293,11 @@ var gSyncSetup = {
|
|||
this.pin3.value.length == PIN_PART_LENGTH);
|
||||
},
|
||||
|
||||
onEmailInput: function () {
|
||||
onEmailInput: function() {
|
||||
// Check account validity when the user stops typing for 1 second.
|
||||
if (this._checkAccountTimer)
|
||||
window.clearTimeout(this._checkAccountTimer);
|
||||
this._checkAccountTimer = window.setTimeout(function () {
|
||||
this._checkAccountTimer = window.setTimeout(function() {
|
||||
gSyncSetup.checkAccount();
|
||||
}, 1000);
|
||||
},
|
||||
|
@ -337,7 +337,7 @@ var gSyncSetup = {
|
|||
this.checkFields();
|
||||
},
|
||||
|
||||
onPasswordChange: function () {
|
||||
onPasswordChange: function() {
|
||||
let password = document.getElementById("weavePassword");
|
||||
let pwconfirm = document.getElementById("weavePasswordConfirm");
|
||||
let [valid, errorString] = gSyncUtils.validatePassword(password, pwconfirm);
|
||||
|
@ -420,7 +420,7 @@ var gSyncSetup = {
|
|||
}
|
||||
},
|
||||
|
||||
onWizardAdvance: function () {
|
||||
onWizardAdvance: function() {
|
||||
// Check pageIndex so we don't prompt before the Sync setup wizard appears.
|
||||
// This is a fallback in case the Master Password gets locked mid-wizard.
|
||||
if ((this.wizard.pageIndex >= 0) &&
|
||||
|
@ -509,7 +509,7 @@ var gSyncSetup = {
|
|||
return true;
|
||||
},
|
||||
|
||||
onWizardBack: function () {
|
||||
onWizardBack: function() {
|
||||
switch (this.wizard.pageIndex) {
|
||||
case NEW_ACCOUNT_START_PAGE:
|
||||
this.wizard.pageIndex = INTRO_PAGE;
|
||||
|
@ -535,7 +535,7 @@ var gSyncSetup = {
|
|||
return true;
|
||||
},
|
||||
|
||||
wizardFinish: function () {
|
||||
wizardFinish: function() {
|
||||
this.setupInitialSync();
|
||||
|
||||
if (this.wizardType == "pair") {
|
||||
|
@ -563,7 +563,7 @@ var gSyncSetup = {
|
|||
window.close();
|
||||
},
|
||||
|
||||
onWizardCancel: function () {
|
||||
onWizardCancel: function() {
|
||||
if (this._resettingSync)
|
||||
return;
|
||||
|
||||
|
@ -572,7 +572,7 @@ var gSyncSetup = {
|
|||
Weave.Service.startOver();
|
||||
},
|
||||
|
||||
onSyncOptions: function () {
|
||||
onSyncOptions: function() {
|
||||
this._beforeOptionsPage = this.wizard.pageIndex;
|
||||
this.wizard.pageIndex = OPTIONS_PAGE;
|
||||
},
|
||||
|
@ -644,7 +644,7 @@ var gSyncSetup = {
|
|||
this._jpakeclient.controller = controller;
|
||||
},
|
||||
|
||||
startEasySetup: function () {
|
||||
startEasySetup: function() {
|
||||
// Don't do anything if we have a client already (e.g. we went to
|
||||
// Sync Options and just came back).
|
||||
if (this._jpakeclient)
|
||||
|
@ -691,7 +691,7 @@ var gSyncSetup = {
|
|||
this._jpakeclient.receiveNoPIN();
|
||||
},
|
||||
|
||||
abortEasySetup: function () {
|
||||
abortEasySetup: function() {
|
||||
document.getElementById("easySetupPIN1").value = "";
|
||||
document.getElementById("easySetupPIN2").value = "";
|
||||
document.getElementById("easySetupPIN3").value = "";
|
||||
|
@ -702,7 +702,7 @@ var gSyncSetup = {
|
|||
delete this._jpakeclient;
|
||||
},
|
||||
|
||||
manualSetup: function () {
|
||||
manualSetup: function() {
|
||||
this.abortEasySetup();
|
||||
this.wizard.pageIndex = EXISTING_ACCOUNT_LOGIN_PAGE;
|
||||
},
|
||||
|
@ -710,7 +710,7 @@ var gSyncSetup = {
|
|||
// _handleNoScript is needed because it blocks the captcha. So we temporarily
|
||||
// allow the necessary sites so that we can verify the user is in fact a human.
|
||||
// This was done with the help of Giorgio (NoScript author). See bug 508112.
|
||||
_handleNoScript: function (addExceptions) {
|
||||
_handleNoScript: function(addExceptions) {
|
||||
// if NoScript isn't installed, or is disabled, bail out.
|
||||
let ns = Cc["@maone.net/noscript-service;1"];
|
||||
if (ns == null)
|
||||
|
@ -734,7 +734,7 @@ var gSyncSetup = {
|
|||
}
|
||||
},
|
||||
|
||||
onExistingServerCommand: function () {
|
||||
onExistingServerCommand: function() {
|
||||
let control = document.getElementById("existingServer");
|
||||
if (control.selectedIndex == 0) {
|
||||
control.removeAttribute("editable");
|
||||
|
@ -750,16 +750,16 @@ var gSyncSetup = {
|
|||
this.checkFields();
|
||||
},
|
||||
|
||||
onExistingServerInput: function () {
|
||||
onExistingServerInput: function() {
|
||||
// Check custom server validity when the user stops typing for 1 second.
|
||||
if (this._existingServerTimer)
|
||||
window.clearTimeout(this._existingServerTimer);
|
||||
this._existingServerTimer = window.setTimeout(function () {
|
||||
this._existingServerTimer = window.setTimeout(function() {
|
||||
gSyncSetup.checkFields();
|
||||
}, 1000);
|
||||
},
|
||||
|
||||
onServerCommand: function () {
|
||||
onServerCommand: function() {
|
||||
setVisibility(document.getElementById("TOSRow"), this._usingMainServers);
|
||||
let control = document.getElementById("server");
|
||||
if (!this._usingMainServers) {
|
||||
|
@ -783,16 +783,16 @@ var gSyncSetup = {
|
|||
this.checkFields();
|
||||
},
|
||||
|
||||
onServerInput: function () {
|
||||
onServerInput: function() {
|
||||
// Check custom server validity when the user stops typing for 1 second.
|
||||
if (this._checkServerTimer)
|
||||
window.clearTimeout(this._checkServerTimer);
|
||||
this._checkServerTimer = window.setTimeout(function () {
|
||||
this._checkServerTimer = window.setTimeout(function() {
|
||||
gSyncSetup.checkServer();
|
||||
}, 1000);
|
||||
},
|
||||
|
||||
checkServer: function () {
|
||||
checkServer: function() {
|
||||
delete this._checkServerTimer;
|
||||
let el = document.getElementById("server");
|
||||
let valid = false;
|
||||
|
@ -813,7 +813,7 @@ var gSyncSetup = {
|
|||
this.checkFields();
|
||||
},
|
||||
|
||||
_validateServer: function (element) {
|
||||
_validateServer: function(element) {
|
||||
let valid = false;
|
||||
let val = element.value;
|
||||
if (!val)
|
||||
|
@ -825,8 +825,8 @@ var gSyncSetup = {
|
|||
uri = Weave.Utils.makeURI("https://" + val);
|
||||
|
||||
if (uri && this._settingUpNew) {
|
||||
function isValid(uri) {
|
||||
Weave.Service.serverURL = uri.spec;
|
||||
function isValid(validUri) {
|
||||
Weave.Service.serverURL = validUri.spec;
|
||||
let check = Weave.Service.checkAccount("a");
|
||||
return (check == "available" || check == "notAvailable");
|
||||
}
|
||||
|
@ -859,7 +859,7 @@ var gSyncSetup = {
|
|||
return valid;
|
||||
},
|
||||
|
||||
_handleChoice: function () {
|
||||
_handleChoice: function() {
|
||||
let desc = document.getElementById("mergeChoiceRadio").selectedIndex;
|
||||
document.getElementById("chosenActionDeck").selectedIndex = desc;
|
||||
switch (desc) {
|
||||
|
@ -983,7 +983,7 @@ var gSyncSetup = {
|
|||
|
||||
// sets class and string on a feedback element
|
||||
// if no property string is passed in, we clear label/style
|
||||
_setFeedback: function (element, success, string) {
|
||||
_setFeedback: function(element, success, string) {
|
||||
element.hidden = success || !string;
|
||||
let classname = success ? "success" : "error";
|
||||
let image = element.getElementsByAttribute("class", "statusIcon")[0];
|
||||
|
@ -993,7 +993,7 @@ var gSyncSetup = {
|
|||
},
|
||||
|
||||
// shim
|
||||
_setFeedbackMessage: function (element, success, string) {
|
||||
_setFeedbackMessage: function(element, success, string) {
|
||||
let str = "";
|
||||
if (string) {
|
||||
try {
|
||||
|
@ -1032,7 +1032,7 @@ var gSyncSetup = {
|
|||
onProgressChange: function() {},
|
||||
onStatusChange: function() {},
|
||||
onSecurityChange: function() {},
|
||||
onLocationChange: function () {}
|
||||
onLocationChange: function() {}
|
||||
};
|
||||
|
||||
// Define lazy getters for various XUL elements.
|
||||
|
@ -1045,12 +1045,12 @@ var gSyncSetup = {
|
|||
"pin2",
|
||||
"pin3",
|
||||
"pairDeviceErrorRow",
|
||||
"pairDeviceThrobber"].forEach(function (id) {
|
||||
"pairDeviceThrobber"].forEach(function(id) {
|
||||
XPCOMUtils.defineLazyGetter(gSyncSetup, id, function() {
|
||||
return document.getElementById(id);
|
||||
});
|
||||
});
|
||||
XPCOMUtils.defineLazyGetter(gSyncSetup, "nextFocusEl", function () {
|
||||
XPCOMUtils.defineLazyGetter(gSyncSetup, "nextFocusEl", function() {
|
||||
return {pin1: this.pin2,
|
||||
pin2: this.pin3,
|
||||
pin3: this.wizard.getButton("next")};
|
||||
|
|
|
@ -22,7 +22,7 @@ var gSyncUtils = {
|
|||
},
|
||||
|
||||
// opens in a new window if we're in a modal prefwindow world, in a new tab otherwise
|
||||
_openLink: function (url) {
|
||||
_openLink: function(url) {
|
||||
let thisDocEl = document.documentElement,
|
||||
openerDocEl = window.opener && window.opener.document.documentElement;
|
||||
if (thisDocEl.id == "accountSetup" && window.opener &&
|
||||
|
@ -58,22 +58,22 @@ var gSyncUtils = {
|
|||
type, duringSetup);
|
||||
},
|
||||
|
||||
changePassword: function () {
|
||||
changePassword: function() {
|
||||
if (Weave.Utils.ensureMPUnlocked())
|
||||
this.openChange("ChangePassword");
|
||||
},
|
||||
|
||||
resetPassphrase: function (duringSetup) {
|
||||
resetPassphrase: function(duringSetup) {
|
||||
if (Weave.Utils.ensureMPUnlocked())
|
||||
this.openChange("ResetPassphrase", duringSetup);
|
||||
},
|
||||
|
||||
updatePassphrase: function () {
|
||||
updatePassphrase: function() {
|
||||
if (Weave.Utils.ensureMPUnlocked())
|
||||
this.openChange("UpdatePassphrase");
|
||||
},
|
||||
|
||||
resetPassword: function () {
|
||||
resetPassword: function() {
|
||||
this._openLink(Weave.Service.pwResetURL);
|
||||
},
|
||||
|
||||
|
@ -82,7 +82,7 @@ var gSyncUtils = {
|
|||
return Weave.Svc.Prefs.get(root + "termsURL");
|
||||
},
|
||||
|
||||
openToS: function () {
|
||||
openToS: function() {
|
||||
this._openLink(this.tosURL);
|
||||
},
|
||||
|
||||
|
@ -91,7 +91,7 @@ var gSyncUtils = {
|
|||
return Weave.Svc.Prefs.get(root + "privacyURL");
|
||||
},
|
||||
|
||||
openPrivacyPolicy: function () {
|
||||
openPrivacyPolicy: function() {
|
||||
this._openLink(this.privacyPolicyURL);
|
||||
},
|
||||
|
||||
|
@ -203,7 +203,7 @@ var gSyncUtils = {
|
|||
*
|
||||
* returns [valid, errorString]
|
||||
*/
|
||||
validatePassword: function (el1, el2) {
|
||||
validatePassword: function(el1, el2) {
|
||||
let valid = false;
|
||||
let val1 = el1.value;
|
||||
let val2 = el2 ? el2.value : "";
|
||||
|
|
|
@ -52,7 +52,7 @@ addEventListener("MozDOMPointerLock:Exited", function(aEvent) {
|
|||
});
|
||||
|
||||
|
||||
addMessageListener("Browser:HideSessionRestoreButton", function (message) {
|
||||
addMessageListener("Browser:HideSessionRestoreButton", function(message) {
|
||||
// Hide session restore button on about:home
|
||||
let doc = content.document;
|
||||
let container;
|
||||
|
@ -401,18 +401,18 @@ var ContentSearchMediator = {
|
|||
"about:newtab",
|
||||
]),
|
||||
|
||||
init: function (chromeGlobal) {
|
||||
init: function(chromeGlobal) {
|
||||
chromeGlobal.addEventListener("ContentSearchClient", this, true, true);
|
||||
addMessageListener("ContentSearch", this);
|
||||
},
|
||||
|
||||
handleEvent: function (event) {
|
||||
handleEvent: function(event) {
|
||||
if (this._contentWhitelisted) {
|
||||
this._sendMsg(event.detail.type, event.detail.data);
|
||||
}
|
||||
},
|
||||
|
||||
receiveMessage: function (msg) {
|
||||
receiveMessage: function(msg) {
|
||||
if (msg.data.type == "AddToWhitelist") {
|
||||
for (let uri of msg.data.data) {
|
||||
this.whitelist.add(uri);
|
||||
|
@ -429,14 +429,14 @@ var ContentSearchMediator = {
|
|||
return this.whitelist.has(content.document.documentURI);
|
||||
},
|
||||
|
||||
_sendMsg: function (type, data=null) {
|
||||
_sendMsg: function(type, data = null) {
|
||||
sendAsyncMessage("ContentSearch", {
|
||||
type: type,
|
||||
data: data,
|
||||
});
|
||||
},
|
||||
|
||||
_fireEvent: function (type, data=null) {
|
||||
_fireEvent: function(type, data = null) {
|
||||
let event = Cu.cloneInto({
|
||||
detail: {
|
||||
type: type,
|
||||
|
@ -491,7 +491,7 @@ var PageStyleHandler = {
|
|||
this.sendStyleSheetInfo();
|
||||
},
|
||||
|
||||
_stylesheetSwitchAll: function (frameset, title) {
|
||||
_stylesheetSwitchAll: function(frameset, title) {
|
||||
if (!title || this._stylesheetInFrame(frameset, title)) {
|
||||
this._stylesheetSwitchFrame(frameset, title);
|
||||
}
|
||||
|
@ -502,7 +502,7 @@ var PageStyleHandler = {
|
|||
}
|
||||
},
|
||||
|
||||
_stylesheetSwitchFrame: function (frame, title) {
|
||||
_stylesheetSwitchFrame: function(frame, title) {
|
||||
var docStyleSheets = frame.document.styleSheets;
|
||||
|
||||
for (let i = 0; i < docStyleSheets.length; ++i) {
|
||||
|
@ -515,7 +515,7 @@ var PageStyleHandler = {
|
|||
}
|
||||
},
|
||||
|
||||
_stylesheetInFrame: function (frame, title) {
|
||||
_stylesheetInFrame: function(frame, title) {
|
||||
return Array.some(frame.document.styleSheets, (styleSheet) => styleSheet.title == title);
|
||||
},
|
||||
|
||||
|
|
|
@ -565,18 +565,18 @@
|
|||
// count of open requests (should always be 0 or 1)
|
||||
mRequestCount: 0,
|
||||
|
||||
destroy: function () {
|
||||
destroy: function() {
|
||||
delete this.mTab;
|
||||
delete this.mBrowser;
|
||||
delete this.mTabBrowser;
|
||||
},
|
||||
|
||||
_callProgressListeners: function () {
|
||||
_callProgressListeners: function() {
|
||||
Array.unshift(arguments, this.mBrowser);
|
||||
return this.mTabBrowser._callProgressListeners.apply(this.mTabBrowser, arguments);
|
||||
},
|
||||
|
||||
_shouldShowProgress: function (aRequest) {
|
||||
_shouldShowProgress: function(aRequest) {
|
||||
if (this.mBlank)
|
||||
return false;
|
||||
|
||||
|
@ -590,9 +590,9 @@
|
|||
return true;
|
||||
},
|
||||
|
||||
onProgressChange: function (aWebProgress, aRequest,
|
||||
aCurSelfProgress, aMaxSelfProgress,
|
||||
aCurTotalProgress, aMaxTotalProgress) {
|
||||
onProgressChange: function(aWebProgress, aRequest,
|
||||
aCurSelfProgress, aMaxSelfProgress,
|
||||
aCurTotalProgress, aMaxTotalProgress) {
|
||||
this.mTotalProgress = aMaxTotalProgress ? aCurTotalProgress / aMaxTotalProgress : 0;
|
||||
|
||||
if (!this._shouldShowProgress(aRequest))
|
||||
|
@ -607,15 +607,15 @@
|
|||
aCurTotalProgress, aMaxTotalProgress]);
|
||||
},
|
||||
|
||||
onProgressChange64: function (aWebProgress, aRequest,
|
||||
aCurSelfProgress, aMaxSelfProgress,
|
||||
aCurTotalProgress, aMaxTotalProgress) {
|
||||
onProgressChange64: function(aWebProgress, aRequest,
|
||||
aCurSelfProgress, aMaxSelfProgress,
|
||||
aCurTotalProgress, aMaxTotalProgress) {
|
||||
return this.onProgressChange(aWebProgress, aRequest,
|
||||
aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress,
|
||||
aMaxTotalProgress);
|
||||
},
|
||||
|
||||
onStateChange: function (aWebProgress, aRequest, aStateFlags, aStatus) {
|
||||
onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) {
|
||||
if (!aRequest)
|
||||
return;
|
||||
|
||||
|
@ -756,8 +756,8 @@
|
|||
this.mStatus = aStatus;
|
||||
},
|
||||
|
||||
onLocationChange: function (aWebProgress, aRequest, aLocation,
|
||||
aFlags) {
|
||||
onLocationChange: function(aWebProgress, aRequest, aLocation,
|
||||
aFlags) {
|
||||
// OnLocationChange is called for both the top-level content
|
||||
// and the subframes.
|
||||
let topLevel = aWebProgress.isTopLevel;
|
||||
|
@ -837,7 +837,7 @@
|
|||
}
|
||||
},
|
||||
|
||||
onStatusChange: function (aWebProgress, aRequest, aStatus, aMessage) {
|
||||
onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage) {
|
||||
if (this.mBlank)
|
||||
return;
|
||||
|
||||
|
@ -847,17 +847,17 @@
|
|||
this.mMessage = aMessage;
|
||||
},
|
||||
|
||||
onSecurityChange: function (aWebProgress, aRequest, aState) {
|
||||
onSecurityChange: function(aWebProgress, aRequest, aState) {
|
||||
this._callProgressListeners("onSecurityChange",
|
||||
[aWebProgress, aRequest, aState]);
|
||||
},
|
||||
|
||||
onRefreshAttempted: function (aWebProgress, aURI, aDelay, aSameURI) {
|
||||
onRefreshAttempted: function(aWebProgress, aURI, aDelay, aSameURI) {
|
||||
return this._callProgressListeners("onRefreshAttempted",
|
||||
[aWebProgress, aURI, aDelay, aSameURI]);
|
||||
},
|
||||
|
||||
QueryInterface: function (aIID) {
|
||||
QueryInterface: function(aIID) {
|
||||
if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
|
||||
aIID.equals(Components.interfaces.nsIWebProgressListener2) ||
|
||||
aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
|
||||
|
@ -2190,7 +2190,7 @@
|
|||
Services.prefs.getBoolPref("browser.tabs.animate");
|
||||
if (!animate) {
|
||||
t.setAttribute("fadein", "true");
|
||||
setTimeout(function (tabContainer) {
|
||||
setTimeout(function(tabContainer) {
|
||||
tabContainer._handleNewTab(t);
|
||||
}, 0, this.tabContainer);
|
||||
}
|
||||
|
@ -2260,7 +2260,7 @@
|
|||
try {
|
||||
b.loadURIWithFlags(aURI, {
|
||||
flags,
|
||||
referrerURI: aNoReferrer ? null: aReferrerURI,
|
||||
referrerURI: aNoReferrer ? null : aReferrerURI,
|
||||
referrerPolicy: aReferrerPolicy,
|
||||
charset: aCharset,
|
||||
postData: aPostData,
|
||||
|
@ -2288,7 +2288,7 @@
|
|||
}
|
||||
|
||||
if (animate) {
|
||||
requestAnimationFrame(function () {
|
||||
requestAnimationFrame(function() {
|
||||
this.tabContainer._handleTabTelemetryStart(t, aURI);
|
||||
|
||||
// kick the animation off
|
||||
|
@ -2480,7 +2480,7 @@
|
|||
aTab.style.maxWidth = ""; // ensure that fade-out transition happens
|
||||
aTab.removeAttribute("fadein");
|
||||
|
||||
setTimeout(function (tab, tabbrowser) {
|
||||
setTimeout(function(tab, tabbrowser) {
|
||||
if (tab.parentNode &&
|
||||
window.getComputedStyle(tab).maxWidth == "0.1px") {
|
||||
NS_ASSERT(false, "Giving up waiting for the tab closing animation to finish (bug 608589)");
|
||||
|
@ -3245,7 +3245,7 @@
|
|||
|
||||
let wasFocused = (document.activeElement == this.mCurrentTab);
|
||||
|
||||
aIndex = aIndex < aTab._tPos ? aIndex: aIndex+1;
|
||||
aIndex = aIndex < aTab._tPos ? aIndex : aIndex + 1;
|
||||
|
||||
// invalidate cache
|
||||
this._visibleTabs = null;
|
||||
|
@ -4140,7 +4140,7 @@
|
|||
* timing.
|
||||
*/
|
||||
|
||||
startTabSwitch: function () {
|
||||
startTabSwitch: function() {
|
||||
TelemetryStopwatch.cancel("FX_TAB_SWITCH_TOTAL_E10S_MS", window);
|
||||
TelemetryStopwatch.start("FX_TAB_SWITCH_TOTAL_E10S_MS", window);
|
||||
this.addMarker("AsyncTabSwitch:Start");
|
||||
|
@ -4153,7 +4153,7 @@
|
|||
* are hidden). This checks to make sure all conditions are
|
||||
* satisfied, and then records the tab switch as finished.
|
||||
*/
|
||||
maybeFinishTabSwitch: function () {
|
||||
maybeFinishTabSwitch: function() {
|
||||
if (this.switchInProgress && this.requestedTab &&
|
||||
this.getTabState(this.requestedTab) == this.STATE_LOADED) {
|
||||
// After this point the tab has switched from the content thread's point of view.
|
||||
|
@ -4168,7 +4168,7 @@
|
|||
}
|
||||
},
|
||||
|
||||
spinnerDisplayed: function () {
|
||||
spinnerDisplayed: function() {
|
||||
this.assert(!this.spinnerTab);
|
||||
TelemetryStopwatch.start("FX_TAB_SWITCH_SPINNER_VISIBLE_MS", window);
|
||||
// We have a second, similar probe for capturing recordings of
|
||||
|
@ -4177,7 +4177,7 @@
|
|||
this.addMarker("AsyncTabSwitch:SpinnerShown");
|
||||
},
|
||||
|
||||
spinnerHidden: function () {
|
||||
spinnerHidden: function() {
|
||||
this.assert(this.spinnerTab);
|
||||
this.log("DEBUG: spinner time = " +
|
||||
TelemetryStopwatch.timeElapsed("FX_TAB_SWITCH_SPINNER_VISIBLE_MS", window));
|
||||
|
@ -4201,7 +4201,7 @@
|
|||
_useDumpForLogging: false,
|
||||
_logInit: false,
|
||||
|
||||
logging: function () {
|
||||
logging: function() {
|
||||
if (this._useDumpForLogging)
|
||||
return true;
|
||||
if (this._logInit)
|
||||
|
@ -4745,7 +4745,7 @@
|
|||
<body><![CDATA[
|
||||
let browser;
|
||||
switch (aTopic) {
|
||||
case "live-resize-start":
|
||||
case "live-resize-start": {
|
||||
browser = this.mCurrentTab.linkedBrowser;
|
||||
let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
|
||||
if (fl && fl.tabParent && !this.mActiveResizeDisplayportSuppression) {
|
||||
|
@ -4753,7 +4753,8 @@
|
|||
this.mActiveResizeDisplayportSuppression = browser;
|
||||
}
|
||||
break;
|
||||
case "live-resize-end":
|
||||
}
|
||||
case "live-resize-end": {
|
||||
browser = this.mActiveResizeDisplayportSuppression;
|
||||
if (browser) {
|
||||
let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
|
||||
|
@ -4763,10 +4764,12 @@
|
|||
}
|
||||
}
|
||||
break;
|
||||
case "nsPref:changed":
|
||||
}
|
||||
case "nsPref:changed": {
|
||||
// This is the only pref observed.
|
||||
this._findAsYouType = Services.prefs.getBoolPref("accessibility.typeaheadfind");
|
||||
break;
|
||||
}
|
||||
}
|
||||
]]></body>
|
||||
</method>
|
||||
|
@ -4957,14 +4960,14 @@
|
|||
self: this,
|
||||
childNodes: [null, this.tabContextMenu, this.tabContainer],
|
||||
firstChild: { nextSibling: this.tabContextMenu },
|
||||
getElementsByAttribute: function (attr, attrValue) {
|
||||
getElementsByAttribute: function(attr, attrValue) {
|
||||
if (attr == "anonid" && attrValue == "tabContextMenu")
|
||||
return [this.self.tabContextMenu];
|
||||
return [];
|
||||
},
|
||||
// Also support adding event listeners (forward to the tab container)
|
||||
addEventListener: function (a, b, c) { this.self.tabContainer.addEventListener(a, b, c); },
|
||||
removeEventListener: function (a, b, c) { this.self.tabContainer.removeEventListener(a, b, c); }
|
||||
addEventListener: function(a, b, c) { this.self.tabContainer.addEventListener(a, b, c); },
|
||||
removeEventListener: function(a, b, c) { this.self.tabContainer.removeEventListener(a, b, c); }
|
||||
});
|
||||
]]>
|
||||
</getter>
|
||||
|
@ -5014,12 +5017,10 @@
|
|||
if (tabForEvent.selected)
|
||||
return;
|
||||
|
||||
// If this is a tabprompt, we won't switch tabs, unless:
|
||||
// - this is a beforeunload prompt
|
||||
// - this behaviour has been disabled entirely using the pref
|
||||
if (event.detail && event.detail.tabPrompt &&
|
||||
!event.detail.inPermitUnload &&
|
||||
Services.prefs.getBoolPref("browser.tabs.dontfocusfordialogs")) {
|
||||
// We always switch tabs for beforeunload tab-modal prompts.
|
||||
if (event.detail &&
|
||||
event.detail.tabPrompt &&
|
||||
!event.detail.inPermitUnload) {
|
||||
let docPrincipal = targetIsWindow ? event.target.document.nodePrincipal : null;
|
||||
// At least one of these should/will be non-null:
|
||||
let promptPrincipal = event.detail.promptPrincipal || docPrincipal ||
|
||||
|
@ -5047,7 +5048,7 @@
|
|||
// URI-based principals, always get to steal focus for the tab when prompting.
|
||||
}
|
||||
|
||||
// if prefs/permissions/origins so dictate, bring tab to the front:
|
||||
// If permissions/origins dictate so, bring tab to the front.
|
||||
this.selectedTab = tabForEvent;
|
||||
]]>
|
||||
</handler>
|
||||
|
@ -5567,7 +5568,7 @@
|
|||
if (!tabs.length)
|
||||
return;
|
||||
|
||||
var isEndTab = (aTab._tPos > tabs[tabs.length-1]._tPos);
|
||||
var isEndTab = (aTab._tPos > tabs[tabs.length - 1]._tPos);
|
||||
var tabWidth = aTab.getBoundingClientRect().width;
|
||||
|
||||
if (!this._tabDefaultMaxWidth)
|
||||
|
@ -5667,7 +5668,7 @@
|
|||
for (let i = numPinned - 1; i >= 0; i--) {
|
||||
let tab = this.childNodes[i];
|
||||
width += tab.getBoundingClientRect().width;
|
||||
tab.style.marginInlineStart = - (width + scrollButtonWidth + paddingStart) + "px";
|
||||
tab.style.marginInlineStart = -(width + scrollButtonWidth + paddingStart) + "px";
|
||||
}
|
||||
|
||||
this.style.paddingInlineStart = width + paddingStart + "px";
|
||||
|
@ -5753,7 +5754,7 @@
|
|||
++mid > high)
|
||||
break;
|
||||
let boxObject = tabs[mid].boxObject;
|
||||
let screenX = boxObject.screenX + getTabShift(tabs[mid], oldIndex);
|
||||
screenX = boxObject.screenX + getTabShift(tabs[mid], oldIndex);
|
||||
if (screenX > tabCenter) {
|
||||
high = mid - 1;
|
||||
} else if (screenX + boxObject.width < tabCenter) {
|
||||
|
@ -5890,7 +5891,7 @@
|
|||
|
||||
if (!this._animateElement.hasAttribute("notifybgtab")) {
|
||||
this._animateElement.setAttribute("notifybgtab", "true");
|
||||
setTimeout(function (ele) {
|
||||
setTimeout(function(ele) {
|
||||
ele.removeAttribute("notifybgtab");
|
||||
}, 150, this._animateElement);
|
||||
}
|
||||
|
@ -6407,7 +6408,7 @@
|
|||
else {
|
||||
let newIndex = this._getDropIndex(event, effects == "link");
|
||||
if (newIndex == this.childNodes.length) {
|
||||
let tabRect = this.childNodes[newIndex-1].getBoundingClientRect();
|
||||
let tabRect = this.childNodes[newIndex - 1].getBoundingClientRect();
|
||||
if (ltr)
|
||||
newMargin = tabRect.right - rect.left;
|
||||
else
|
||||
|
|
|
@ -16,10 +16,11 @@ add_task(function* test_notificationClose() {
|
|||
|
||||
yield PlacesTestUtils.addVisits(notificationURI);
|
||||
let faviconURI = yield new Promise(resolve => {
|
||||
let faviconURI = makeURI("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVQI12P4//8/AAX+Av7czFnnAAAAAElFTkSuQmCC");
|
||||
PlacesUtils.favicons.setAndFetchFaviconForPage(notificationURI, faviconURI,
|
||||
let uri =
|
||||
makeURI("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVQI12P4//8/AAX+Av7czFnnAAAAAElFTkSuQmCC");
|
||||
PlacesUtils.favicons.setAndFetchFaviconForPage(notificationURI, uri,
|
||||
true, PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
|
||||
(faviconURI, iconSize, iconData, mimeType) => resolve(faviconURI),
|
||||
(uriResult) => resolve(uriResult),
|
||||
Services.scriptSecurityManager.getSystemPrincipal());
|
||||
});
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ const ALERT_SERVICE = Cc["@mozilla.org/alerts-service;1"]
|
|||
.getService(Ci.nsIAlertsService)
|
||||
.QueryInterface(Ci.nsIAlertsDoNotDisturb);
|
||||
|
||||
function test () {
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
try {
|
||||
|
|
|
@ -5,7 +5,7 @@ var notificationURL = "http://example.org/browser/browser/base/content/test/aler
|
|||
var alertWindowClosed = false;
|
||||
var permRemoved = false;
|
||||
|
||||
function test () {
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
let pm = Services.perms;
|
||||
|
|
|
@ -24,11 +24,11 @@ add_task(function* test_notificationPreventDefaultAndSwitchTabs() {
|
|||
|
||||
// First, show a notification that will be have the tab-switching prevented.
|
||||
function promiseNotificationEvent(evt) {
|
||||
return ContentTask.spawn(aBrowser, evt, function* (evt) {
|
||||
return ContentTask.spawn(aBrowser, evt, function* (contentEvt) {
|
||||
return yield new Promise(resolve => {
|
||||
let notification = content.wrappedJSObject._notification;
|
||||
notification.addEventListener(evt, function l(event) {
|
||||
notification.removeEventListener(evt, l);
|
||||
let contentNotification = content.wrappedJSObject._notification;
|
||||
contentNotification.addEventListener(contentEvt, function l(event) {
|
||||
contentNotification.removeEventListener(contentEvt, l);
|
||||
resolve({ defaultPrevented: event.defaultPrevented });
|
||||
});
|
||||
});
|
||||
|
|
|
@ -42,9 +42,9 @@ function promiseWindowClosed(window) {
|
|||
* rejected after the requested number of miliseconds.
|
||||
*/
|
||||
function openNotification(aBrowser, fn, timeout) {
|
||||
return ContentTask.spawn(aBrowser, { fn, timeout }, function* ({ fn, timeout }) {
|
||||
return ContentTask.spawn(aBrowser, [fn, timeout], function* ([contentFn, contentTimeout]) {
|
||||
let win = content.wrappedJSObject;
|
||||
let notification = win[fn]();
|
||||
let notification = win[contentFn]();
|
||||
win._notification = notification;
|
||||
yield new Promise((resolve, reject) => {
|
||||
function listener() {
|
||||
|
@ -54,11 +54,11 @@ function openNotification(aBrowser, fn, timeout) {
|
|||
|
||||
notification.addEventListener("show", listener);
|
||||
|
||||
if (timeout) {
|
||||
if (contentTimeout) {
|
||||
content.setTimeout(() => {
|
||||
notification.removeEventListener("show", listener);
|
||||
reject("timed out");
|
||||
}, timeout);
|
||||
}, contentTimeout);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
addMessageListener("AboutHome:SearchTriggered", function (msg) {
|
||||
addMessageListener("AboutHome:SearchTriggered", function(msg) {
|
||||
sendAsyncMessage("AboutHomeTest:CheckRecordedSearch", msg.data);
|
||||
});
|
||||
|
|
|
@ -68,7 +68,7 @@ var gTests = [
|
|||
Preferences.set("datareporting.healthreport.about.reportUrl",
|
||||
HTTPS_BASE + "healthreport_testRemoteCommands.html");
|
||||
}),
|
||||
run: function (iframe)
|
||||
run: function(iframe)
|
||||
{
|
||||
let deferred = Promise.defer();
|
||||
let results = 0;
|
||||
|
@ -119,7 +119,7 @@ function test()
|
|||
});
|
||||
}
|
||||
|
||||
function promiseNewTabLoadEvent(aUrl, aEventType="load")
|
||||
function promiseNewTabLoadEvent(aUrl, aEventType = "load")
|
||||
{
|
||||
let deferred = Promise.defer();
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab(aUrl);
|
||||
|
|
|
@ -292,7 +292,7 @@ add_task(function* () {
|
|||
}
|
||||
|
||||
if (n > 0) {
|
||||
executeSoon(() => check(n-1));
|
||||
executeSoon(() => check(n - 1));
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
|
@ -497,7 +497,7 @@ add_task(function* () {
|
|||
yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:home" }, function* (browser) {
|
||||
let oldOpenPrefs = window.openPreferences;
|
||||
let openPrefsPromise = new Promise(resolve => {
|
||||
window.openPreferences = function (pane, params) {
|
||||
window.openPreferences = function(pane, params) {
|
||||
resolve({ pane: pane, params: params });
|
||||
};
|
||||
});
|
||||
|
@ -650,7 +650,7 @@ function promiseNewEngine(basename) {
|
|||
return new Promise((resolve, reject) => {
|
||||
let url = getRootDirectory(gTestPath) + basename;
|
||||
Services.search.addEngine(url, null, "", false, {
|
||||
onSuccess: function (engine) {
|
||||
onSuccess: function(engine) {
|
||||
info("Search engine added: " + basename);
|
||||
registerCleanupFunction(() => {
|
||||
try {
|
||||
|
@ -659,7 +659,7 @@ function promiseNewEngine(basename) {
|
|||
});
|
||||
resolve(engine);
|
||||
},
|
||||
onError: function (errCode) {
|
||||
onError: function(errCode) {
|
||||
ok(false, "addEngine failed with error code " + errCode);
|
||||
reject();
|
||||
},
|
||||
|
|
|
@ -4,12 +4,12 @@ const gCompleteState = Ci.nsIWebProgressListener.STATE_STOP +
|
|||
Ci.nsIWebProgressListener.STATE_IS_NETWORK;
|
||||
|
||||
var gFrontProgressListener = {
|
||||
onProgressChange: function (aWebProgress, aRequest,
|
||||
aCurSelfProgress, aMaxSelfProgress,
|
||||
aCurTotalProgress, aMaxTotalProgress) {
|
||||
onProgressChange: function(aWebProgress, aRequest,
|
||||
aCurSelfProgress, aMaxSelfProgress,
|
||||
aCurTotalProgress, aMaxTotalProgress) {
|
||||
},
|
||||
|
||||
onStateChange: function (aWebProgress, aRequest, aStateFlags, aStatus) {
|
||||
onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) {
|
||||
var state = "onStateChange";
|
||||
info("FrontProgress: " + state + " 0x" + aStateFlags.toString(16));
|
||||
ok(gFrontNotificationsPos < gFrontNotifications.length, "Got an expected notification for the front notifications listener");
|
||||
|
@ -17,7 +17,7 @@ var gFrontProgressListener = {
|
|||
gFrontNotificationsPos++;
|
||||
},
|
||||
|
||||
onLocationChange: function (aWebProgress, aRequest, aLocationURI, aFlags) {
|
||||
onLocationChange: function(aWebProgress, aRequest, aLocationURI, aFlags) {
|
||||
var state = "onLocationChange";
|
||||
info("FrontProgress: " + state + " " + aLocationURI.spec);
|
||||
ok(gFrontNotificationsPos < gFrontNotifications.length, "Got an expected notification for the front notifications listener");
|
||||
|
@ -25,10 +25,10 @@ var gFrontProgressListener = {
|
|||
gFrontNotificationsPos++;
|
||||
},
|
||||
|
||||
onStatusChange: function (aWebProgress, aRequest, aStatus, aMessage) {
|
||||
onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage) {
|
||||
},
|
||||
|
||||
onSecurityChange: function (aWebProgress, aRequest, aState) {
|
||||
onSecurityChange: function(aWebProgress, aRequest, aState) {
|
||||
var state = "onSecurityChange";
|
||||
info("FrontProgress: " + state + " 0x" + aState.toString(16));
|
||||
ok(gFrontNotificationsPos < gFrontNotifications.length, "Got an expected notification for the front notifications listener");
|
||||
|
@ -38,7 +38,7 @@ var gFrontProgressListener = {
|
|||
}
|
||||
|
||||
var gAllProgressListener = {
|
||||
onStateChange: function (aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
|
||||
onStateChange: function(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
|
||||
var state = "onStateChange";
|
||||
info("AllProgress: " + state + " 0x" + aStateFlags.toString(16));
|
||||
ok(aBrowser == gTestBrowser, state + " notification came from the correct browser");
|
||||
|
@ -53,8 +53,8 @@ var gAllProgressListener = {
|
|||
}
|
||||
},
|
||||
|
||||
onLocationChange: function (aBrowser, aWebProgress, aRequest, aLocationURI,
|
||||
aFlags) {
|
||||
onLocationChange: function(aBrowser, aWebProgress, aRequest, aLocationURI,
|
||||
aFlags) {
|
||||
var state = "onLocationChange";
|
||||
info("AllProgress: " + state + " " + aLocationURI.spec);
|
||||
ok(aBrowser == gTestBrowser, state + " notification came from the correct browser");
|
||||
|
@ -63,12 +63,12 @@ var gAllProgressListener = {
|
|||
gAllNotificationsPos++;
|
||||
},
|
||||
|
||||
onStatusChange: function (aBrowser, aWebProgress, aRequest, aStatus, aMessage) {
|
||||
onStatusChange: function(aBrowser, aWebProgress, aRequest, aStatus, aMessage) {
|
||||
var state = "onStatusChange";
|
||||
ok(aBrowser == gTestBrowser, state + " notification came from the correct browser");
|
||||
},
|
||||
|
||||
onSecurityChange: function (aBrowser, aWebProgress, aRequest, aState) {
|
||||
onSecurityChange: function(aBrowser, aWebProgress, aRequest, aState) {
|
||||
var state = "onSecurityChange";
|
||||
info("AllProgress: " + state + " 0x" + aState.toString(16));
|
||||
ok(aBrowser == gTestBrowser, state + " notification came from the correct browser");
|
||||
|
|
|
@ -38,7 +38,7 @@ function test() {
|
|||
// non-builtin roots.
|
||||
Services.prefs.setIntPref(kpkpEnforcementPref, 2);
|
||||
Services.prefs.setBoolPref(khpkpPinninEnablePref, true);
|
||||
registerCleanupFunction(function () {
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref(kpkpEnforcementPref);
|
||||
Services.prefs.clearUserPref(khpkpPinninEnablePref);
|
||||
let uri = gIOService.newURI("https://" + kPinningDomain, null, null);
|
||||
|
|
|
@ -42,7 +42,7 @@ add_task(function* () {
|
|||
BrowserOffline.toggleOfflineStatus();
|
||||
let proxy = Services.prefs.getIntPref('network.proxy.type');
|
||||
Services.prefs.setIntPref('network.proxy.type', 0);
|
||||
registerCleanupFunction(function () {
|
||||
registerCleanupFunction(function() {
|
||||
BrowserOffline.toggleOfflineStatus();
|
||||
Services.prefs.setIntPref('network.proxy.type', proxy);
|
||||
});
|
||||
|
|
|
@ -31,6 +31,6 @@ add_task(function* () {
|
|||
is(gBrowser.tabs.length, initialTabsNo, "No additional tabs were opened");
|
||||
});
|
||||
|
||||
registerCleanupFunction(function () {
|
||||
registerCleanupFunction(function() {
|
||||
gBrowser.removeTab(gBrowser.selectedTab);
|
||||
});
|
||||
|
|
|
@ -47,7 +47,7 @@ const kURIs = [
|
|||
|
||||
var gProgressListener = {
|
||||
_runCount: 0,
|
||||
onStateChange: function (aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
|
||||
onStateChange: function(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
|
||||
if ((aStateFlags & kCompleteState) == kCompleteState) {
|
||||
if (++this._runCount != kURIs.length)
|
||||
return;
|
||||
|
@ -86,7 +86,7 @@ function finishTest() {
|
|||
gBrowser.removeTabsProgressListener(gProgressListener);
|
||||
|
||||
// Close opened tabs
|
||||
for (var i = gBrowser.tabs.length-1; i > 0; i--)
|
||||
for (var i = gBrowser.tabs.length - 1; i > 0; i--)
|
||||
gBrowser.removeTab(gBrowser.tabs[i]);
|
||||
|
||||
finish();
|
||||
|
|
|
@ -24,7 +24,7 @@ function addTab(aURI, aIndex) {
|
|||
if (aIndex == 0)
|
||||
gBrowser.removeTab(gBrowser.tabs[0], {skipPermitUnload: true});
|
||||
|
||||
tab.linkedBrowser.addEventListener("load", function (event) {
|
||||
tab.linkedBrowser.addEventListener("load", function(event) {
|
||||
event.currentTarget.removeEventListener("load", arguments.callee, true);
|
||||
if (++count == URIS.length)
|
||||
executeSoon(doTabsTest);
|
||||
|
@ -35,11 +35,11 @@ function doTabsTest() {
|
|||
is(gBrowser.tabs.length, URIS.length, "Correctly opened all expected tabs");
|
||||
|
||||
// sample of "close related tabs" feature
|
||||
gBrowser.tabContainer.addEventListener("TabClose", function (event) {
|
||||
gBrowser.tabContainer.addEventListener("TabClose", function(event) {
|
||||
event.currentTarget.removeEventListener("TabClose", arguments.callee, true);
|
||||
var closedTab = event.originalTarget;
|
||||
var scheme = closedTab.linkedBrowser.currentURI.scheme;
|
||||
Array.slice(gBrowser.tabs).forEach(function (aTab) {
|
||||
Array.slice(gBrowser.tabs).forEach(function(aTab) {
|
||||
if (aTab != closedTab && aTab.linkedBrowser.currentURI.scheme == scheme)
|
||||
gBrowser.removeTab(aTab, {skipPermitUnload: true});
|
||||
});
|
||||
|
|
|
@ -12,7 +12,7 @@ function start_test_prefNotSet() {
|
|||
}).then(continue_test_prefNotSet, FullZoomHelper.failAndContinue(finish));
|
||||
}
|
||||
|
||||
function continue_test_prefNotSet () {
|
||||
function continue_test_prefNotSet() {
|
||||
Task.spawn(function* () {
|
||||
is(ZoomManager.zoom, 1, "zoom level pref should not apply to an image");
|
||||
yield FullZoom.reset();
|
||||
|
|
|
@ -10,7 +10,7 @@ function testChromeless() {
|
|||
"chrome,dialog=no,location=yes,toolbar=no", "about:blank");
|
||||
ok(newWin, "got new window");
|
||||
|
||||
whenDelayedStartupFinished(newWin, function () {
|
||||
whenDelayedStartupFinished(newWin, function() {
|
||||
// Check that the search bar is hidden
|
||||
var searchBar = newWin.BrowserSearch.searchBar;
|
||||
ok(searchBar, "got search bar");
|
||||
|
@ -19,7 +19,7 @@ function testChromeless() {
|
|||
is(searchBarBO.width, 0, "search bar hidden");
|
||||
is(searchBarBO.height, 0, "search bar hidden");
|
||||
|
||||
testCustomize(newWin, function () {
|
||||
testCustomize(newWin, function() {
|
||||
newWin.close();
|
||||
finish();
|
||||
});
|
||||
|
@ -31,7 +31,7 @@ function testCustomize(aWindow, aCallback) {
|
|||
ok(fileMenu, "got file menu");
|
||||
is(fileMenu.disabled, false, "file menu initially enabled");
|
||||
|
||||
openToolbarCustomizationUI(function () {
|
||||
openToolbarCustomizationUI(function() {
|
||||
// Can't use the property, since the binding may have since been removed
|
||||
// if the element is hidden (see bug 422590)
|
||||
is(fileMenu.getAttribute("disabled"), "true",
|
||||
|
|
|
@ -71,7 +71,7 @@ function test2Setup() {
|
|||
var contentAreaContextMenu = document.getElementById("contentAreaContextMenu");
|
||||
var contextMenu = new nsContextMenu(contentAreaContextMenu);
|
||||
|
||||
gBrowser.tabContainer.addEventListener("TabOpen", function (event) {
|
||||
gBrowser.tabContainer.addEventListener("TabOpen", function(event) {
|
||||
test2tab = event.target;
|
||||
gBrowser.tabContainer.removeEventListener("TabOpen", arguments.callee, false);
|
||||
}, false);
|
||||
|
@ -107,7 +107,7 @@ function test3Setup() {
|
|||
var contentAreaContextMenu = document.getElementById("contentAreaContextMenu");
|
||||
var contextMenu = new nsContextMenu(contentAreaContextMenu);
|
||||
|
||||
Services.ww.registerNotification(function (aSubject, aTopic, aData) {
|
||||
Services.ww.registerNotification(function(aSubject, aTopic, aData) {
|
||||
if (aTopic == "domwindowopened")
|
||||
test3window = aSubject;
|
||||
Services.ww.unregisterNotification(arguments.callee);
|
||||
|
|
|
@ -5,7 +5,7 @@ function remote(task) {
|
|||
add_task(function* () {
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
|
||||
let promise = remote(function () {
|
||||
let promise = remote(function() {
|
||||
return ContentTaskUtils.waitForEvent(this, "DOMContentLoaded", true, event => {
|
||||
return content.document.documentURI != "about:blank";
|
||||
}).then(() => 0); // don't want to send the event to the chrome process
|
||||
|
@ -30,7 +30,7 @@ add_task(function* () {
|
|||
// Tweak the expert mode pref
|
||||
gPrefService.setBoolPref("browser.xul.error_pages.expert_bad_cert", true);
|
||||
|
||||
promise = remote(function () {
|
||||
promise = remote(function() {
|
||||
return ContentTaskUtils.waitForEvent(this, "DOMContentLoaded", true);
|
||||
});
|
||||
gBrowser.reload();
|
||||
|
|
|
@ -29,7 +29,7 @@ function test() {
|
|||
|
||||
// Start the sub-document load.
|
||||
let deferred = Promise.defer();
|
||||
executeSoon(function () {
|
||||
executeSoon(function() {
|
||||
BrowserTestUtils.browserLoaded(testBrowser, true).then(url => {
|
||||
is(url, TEST_IFRAME_URL, "got the load event for the iframe");
|
||||
is(ZoomManager.zoom, zoomLevel, "zoom is retained after sub-document load");
|
||||
|
|
|
@ -5,16 +5,16 @@ function test() {
|
|||
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
|
||||
gBrowser.selectedBrowser.addEventListener("load", function () {
|
||||
gBrowser.selectedBrowser.addEventListener("load", function() {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
var pageInfo = BrowserPageInfo(gBrowser.selectedBrowser.currentURI.spec,
|
||||
"mediaTab");
|
||||
|
||||
pageInfo.addEventListener("load", function () {
|
||||
pageInfo.addEventListener("load", function() {
|
||||
pageInfo.removeEventListener("load", arguments.callee, true);
|
||||
pageInfo.onFinished.push(function () {
|
||||
executeSoon(function () {
|
||||
pageInfo.onFinished.push(function() {
|
||||
executeSoon(function() {
|
||||
var imageTree = pageInfo.document.getElementById("imagetree");
|
||||
var imageRowsNum = imageTree.view.rowCount;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
// That's a gecko!
|
||||
const iconURLSpec = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg==";
|
||||
var testPage="data:text/plain,test bug 477014";
|
||||
var testPage = "data:text/plain,test bug 477014";
|
||||
|
||||
add_task(function*() {
|
||||
let tabToDetach = gBrowser.addTab(testPage);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
whenNewWindowLoaded(null, function (win) {
|
||||
waitForFocus(function () {
|
||||
whenNewWindowLoaded(null, function(win) {
|
||||
waitForFocus(function() {
|
||||
function onTabClose() {
|
||||
ok(false, "shouldn't have gotten the TabClose event for the last tab");
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ function test() {
|
|||
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
|
||||
gBrowser.selectedBrowser.addEventListener("load", function () {
|
||||
gBrowser.selectedBrowser.addEventListener("load", function() {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
var doc = gBrowser.contentDocument;
|
||||
|
@ -13,10 +13,10 @@ function test() {
|
|||
var pageInfo = BrowserPageInfo(gBrowser.selectedBrowser.currentURI.spec,
|
||||
"mediaTab", testImg);
|
||||
|
||||
pageInfo.addEventListener("load", function () {
|
||||
pageInfo.addEventListener("load", function() {
|
||||
pageInfo.removeEventListener("load", arguments.callee, true);
|
||||
pageInfo.onFinished.push(function () {
|
||||
executeSoon(function () {
|
||||
pageInfo.onFinished.push(function() {
|
||||
executeSoon(function() {
|
||||
var pageInfoImg = pageInfo.document.getElementById("thepreviewimage");
|
||||
|
||||
is(pageInfoImg.src, testImg.src, "selected image has the correct source");
|
||||
|
|
|
@ -28,7 +28,7 @@ var progressListener3 = {
|
|||
ok(calledListener2, "called progressListener2 before progressListener3");
|
||||
gBrowser.removeProgressListener(this);
|
||||
gBrowser.addProgressListener(progressListener4);
|
||||
executeSoon(function () {
|
||||
executeSoon(function() {
|
||||
expectListener4 = true;
|
||||
gBrowser.reload();
|
||||
});
|
||||
|
|
|
@ -33,7 +33,7 @@ var newWindow;
|
|||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
registerCleanupFunction(function () {
|
||||
registerCleanupFunction(function() {
|
||||
while (tabs.length) {
|
||||
gBrowser.removeTab(tabs.pop());
|
||||
}
|
||||
|
|
|
@ -499,7 +499,7 @@ function test_multiple() {
|
|||
installs[0].cancel();
|
||||
|
||||
let addon = yield new Promise(resolve => {
|
||||
AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function (result) {
|
||||
AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function(result) {
|
||||
resolve(result);
|
||||
});
|
||||
});
|
||||
|
@ -1121,7 +1121,7 @@ function test_failedSecurity() {
|
|||
var gTestStart = null;
|
||||
|
||||
var XPInstallObserver = {
|
||||
observe: function (aSubject, aTopic, aData) {
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
var installInfo = aSubject.QueryInterface(Components.interfaces.amIWebInstallInfo);
|
||||
info("Observed " + aTopic + " for " + installInfo.installs.length + " installs");
|
||||
installInfo.installs.forEach(function(aInstall) {
|
||||
|
|
|
@ -17,7 +17,7 @@ function checkPopupHide()
|
|||
var gObserver = {
|
||||
QueryInterface : XPCOMUtils.generateQI([Ci.nsIFormSubmitObserver]),
|
||||
|
||||
notifyInvalidSubmit : function (aFormElement, aInvalidElements)
|
||||
notifyInvalidSubmit : function(aFormElement, aInvalidElements)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
@ -297,14 +297,14 @@ add_task(function* ()
|
|||
|
||||
// Clean-up
|
||||
Services.obs.removeObserver(gObserver, "invalidformsubmit");
|
||||
gObserver.notifyInvalidSubmit = function () {};
|
||||
gObserver.notifyInvalidSubmit = function() {};
|
||||
resolve();
|
||||
});
|
||||
};
|
||||
|
||||
Services.obs.addObserver(gObserver, "invalidformsubmit", false);
|
||||
|
||||
executeSoon(function () {
|
||||
executeSoon(function() {
|
||||
browser.contentDocument.getElementById('s').click();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -23,10 +23,10 @@ function checkAnimationState() {
|
|||
|
||||
info("tab didn't close immediately, so the tab opening animation must have started moving");
|
||||
info("waiting for the tab to close asynchronously");
|
||||
tab.addEventListener("transitionend", function (event) {
|
||||
tab.addEventListener("transitionend", function(event) {
|
||||
if (event.propertyName == "max-width") {
|
||||
tab.removeEventListener("transitionend", arguments.callee, false);
|
||||
executeSoon(function () {
|
||||
executeSoon(function() {
|
||||
ok(!tab.parentNode, "tab removed asynchronously");
|
||||
finish();
|
||||
});
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
Services.ww.registerNotification(function (aSubject, aTopic, aData) {
|
||||
Services.ww.registerNotification(function(aSubject, aTopic, aData) {
|
||||
if (aTopic == "domwindowopened") {
|
||||
Services.ww.unregisterNotification(arguments.callee);
|
||||
|
||||
ok(true, "duplicateTabIn opened a new window");
|
||||
|
||||
whenDelayedStartupFinished(aSubject, function () {
|
||||
executeSoon(function () {
|
||||
whenDelayedStartupFinished(aSubject, function() {
|
||||
executeSoon(function() {
|
||||
aSubject.close();
|
||||
finish();
|
||||
});
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
loadAndWait("data:text/plain,1", function () {
|
||||
loadAndWait("data:text/plain,2", function () {
|
||||
loadAndWait("data:text/plain,1", function() {
|
||||
loadAndWait("data:text/plain,2", function() {
|
||||
loadAndWait("data:text/plain,3", runTests);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function runTests() {
|
||||
duplicate(0, "maintained the original index", function () {
|
||||
duplicate(0, "maintained the original index", function() {
|
||||
gBrowser.removeCurrentTab();
|
||||
|
||||
duplicate(-1, "went back", function () {
|
||||
duplicate(1, "went forward", function () {
|
||||
duplicate(-1, "went back", function() {
|
||||
duplicate(1, "went forward", function() {
|
||||
gBrowser.removeCurrentTab();
|
||||
gBrowser.removeCurrentTab();
|
||||
gBrowser.addTab();
|
||||
|
@ -38,7 +38,7 @@ function duplicate(delta, msg, cb) {
|
|||
}
|
||||
|
||||
function loadAndWait(url, cb) {
|
||||
gBrowser.selectedBrowser.addEventListener("load", function () {
|
||||
gBrowser.selectedBrowser.addEventListener("load", function() {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
executeSoon(cb);
|
||||
}, true);
|
||||
|
|
|
@ -3,12 +3,12 @@ function test() {
|
|||
|
||||
var tab = gBrowser.addTab();
|
||||
|
||||
tab.addEventListener("TabClose", function () {
|
||||
tab.addEventListener("TabClose", function() {
|
||||
tab.removeEventListener("TabClose", arguments.callee, false);
|
||||
|
||||
ok(tab.linkedBrowser, "linkedBrowser should still exist during the TabClose event");
|
||||
|
||||
executeSoon(function () {
|
||||
executeSoon(function() {
|
||||
ok(!tab.linkedBrowser, "linkedBrowser should be gone after the TabClose event");
|
||||
|
||||
finish();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function test () {
|
||||
function test() {
|
||||
requestLongerTimeout(3);
|
||||
waitForExplicitFinish();
|
||||
|
||||
|
@ -6,9 +6,9 @@ function test () {
|
|||
|
||||
function loadListener() {
|
||||
function testLocation(link, url, next) {
|
||||
new TabOpenListener(url, function () {
|
||||
new TabOpenListener(url, function() {
|
||||
gBrowser.removeTab(this.tab);
|
||||
}, function () {
|
||||
}, function() {
|
||||
next();
|
||||
});
|
||||
|
||||
|
@ -18,7 +18,7 @@ function test () {
|
|||
}
|
||||
|
||||
function testLink(link, name, next) {
|
||||
addWindowListener("chrome://mozapps/content/downloads/unknownContentType.xul", function (win) {
|
||||
addWindowListener("chrome://mozapps/content/downloads/unknownContentType.xul", function(win) {
|
||||
ContentTask.spawn(gBrowser.selectedBrowser, null, () => {
|
||||
Assert.equal(content.document.getElementById("unload-flag").textContent,
|
||||
"Okay", "beforeunload shouldn't have fired");
|
||||
|
@ -41,7 +41,7 @@ function test () {
|
|||
testLink.bind(null, "link5", "javascript.txt",
|
||||
testLink.bind(null, "link6", "test.blob",
|
||||
testLocation.bind(null, "link7", "http://example.com/",
|
||||
function () {
|
||||
function() {
|
||||
if (isHTTPS) {
|
||||
finish();
|
||||
} else {
|
||||
|
|
|
@ -13,7 +13,7 @@ function test() {
|
|||
|
||||
BrowserOpenTab();
|
||||
let tab = gBrowser.selectedTab;
|
||||
registerCleanupFunction(function () { gBrowser.removeTab(tab); });
|
||||
registerCleanupFunction(function() { gBrowser.removeTab(tab); });
|
||||
|
||||
ok(gHistorySwipeAnimation, "gHistorySwipeAnimation exists.");
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ add_task(function* ()
|
|||
name: "view background image",
|
||||
url: "http://mochi.test:8888/",
|
||||
element: "body",
|
||||
go: function () {
|
||||
go: function() {
|
||||
return ContentTask.spawn(gBrowser.selectedBrowser, { writeDomainURL: writeDomainURL }, function* (arg) {
|
||||
let contentBody = content.document.body;
|
||||
contentBody.style.backgroundImage = "url('" + arg.writeDomainURL + "')";
|
||||
|
@ -23,7 +23,7 @@ add_task(function* ()
|
|||
return "context-viewbgimage";
|
||||
});
|
||||
},
|
||||
verify: function () {
|
||||
verify: function() {
|
||||
return ContentTask.spawn(gBrowser.selectedBrowser, null, function* (arg) {
|
||||
Assert.ok(!content.document.body.textContent,
|
||||
"no domain was inherited for view background image");
|
||||
|
@ -34,7 +34,7 @@ add_task(function* ()
|
|||
name: "view image",
|
||||
url: "http://mochi.test:8888/",
|
||||
element: "img",
|
||||
go: function () {
|
||||
go: function() {
|
||||
return ContentTask.spawn(gBrowser.selectedBrowser, { writeDomainURL: writeDomainURL }, function* (arg) {
|
||||
let doc = content.document;
|
||||
let img = doc.createElement("img");
|
||||
|
@ -46,7 +46,7 @@ add_task(function* ()
|
|||
return "context-viewimage";
|
||||
});
|
||||
},
|
||||
verify: function () {
|
||||
verify: function() {
|
||||
return ContentTask.spawn(gBrowser.selectedBrowser, null, function* (arg) {
|
||||
Assert.ok(!content.document.body.textContent,
|
||||
"no domain was inherited for view image");
|
||||
|
@ -57,7 +57,7 @@ add_task(function* ()
|
|||
name: "show only this frame",
|
||||
url: "http://mochi.test:8888/",
|
||||
element: "iframe",
|
||||
go: function () {
|
||||
go: function() {
|
||||
return ContentTask.spawn(gBrowser.selectedBrowser, { writeDomainURL: writeDomainURL }, function* (arg) {
|
||||
let doc = content.document;
|
||||
let iframe = doc.createElement("iframe");
|
||||
|
@ -73,7 +73,7 @@ add_task(function* ()
|
|||
});
|
||||
});
|
||||
},
|
||||
verify: function () {
|
||||
verify: function() {
|
||||
return ContentTask.spawn(gBrowser.selectedBrowser, null, function* (arg) {
|
||||
Assert.ok(!content.document.body.textContent,
|
||||
"no domain was inherited for 'show only this frame'");
|
||||
|
|
|
@ -12,7 +12,7 @@ function test() {
|
|||
}
|
||||
|
||||
function testPreferences() {
|
||||
whenTabLoaded(gBrowser.selectedTab, function () {
|
||||
whenTabLoaded(gBrowser.selectedTab, function() {
|
||||
is(content.location.href, "about:preferences", "Checking if the preferences tab was opened");
|
||||
|
||||
gBrowser.removeCurrentTab();
|
||||
|
|
|
@ -9,17 +9,17 @@ function test() {
|
|||
waitForExplicitFinish();
|
||||
|
||||
Services.prefs.setBoolPref(PREF, true);
|
||||
registerCleanupFunction(function () {
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref(PREF);
|
||||
});
|
||||
|
||||
preparePendingTab(function (aTab) {
|
||||
preparePendingTab(function(aTab) {
|
||||
let win = gBrowser.replaceTabWithWindow(aTab);
|
||||
|
||||
whenDelayedStartupFinished(win, function () {
|
||||
whenDelayedStartupFinished(win, function() {
|
||||
let [tab] = win.gBrowser.tabs;
|
||||
|
||||
whenLoaded(tab.linkedBrowser, function () {
|
||||
whenLoaded(tab.linkedBrowser, function() {
|
||||
is(tab.linkedBrowser.currentURI.spec, URL, "correct url should be loaded");
|
||||
ok(!tab.hasAttribute("pending"), "tab should not be pending");
|
||||
|
||||
|
@ -33,12 +33,12 @@ function test() {
|
|||
function preparePendingTab(aCallback) {
|
||||
let tab = gBrowser.addTab(URL);
|
||||
|
||||
whenLoaded(tab.linkedBrowser, function () {
|
||||
whenLoaded(tab.linkedBrowser, function() {
|
||||
BrowserTestUtils.removeTab(tab).then(() => {
|
||||
let [{state}] = JSON.parse(SessionStore.getClosedTabData(window));
|
||||
|
||||
tab = gBrowser.addTab("about:blank");
|
||||
whenLoaded(tab.linkedBrowser, function () {
|
||||
whenLoaded(tab.linkedBrowser, function() {
|
||||
SessionStore.setTabState(tab, JSON.stringify(state));
|
||||
ok(tab.hasAttribute("pending"), "tab should be pending");
|
||||
aCallback(tab);
|
||||
|
|
|
@ -35,7 +35,7 @@ add_task(function*() {
|
|||
let output = yield ContentTask.spawn(browser, { }, function* (arg) {
|
||||
return content.document.getElementById("output").textContent;
|
||||
});
|
||||
is (output, "Passed", "Paste file");
|
||||
is(output, "Passed", "Paste file");
|
||||
|
||||
textbox.focus();
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ add_task(function* test_alt_click()
|
|||
// When 1 download has been attempted then resolve the promise.
|
||||
let finishedAllDownloads = new Promise( (resolve) => {
|
||||
downloadView = {
|
||||
onDownloadAdded: function (aDownload) {
|
||||
onDownloadAdded: function(aDownload) {
|
||||
downloads.push(aDownload);
|
||||
resolve();
|
||||
},
|
||||
|
@ -83,7 +83,7 @@ add_task(function* test_alt_click_on_xlinks()
|
|||
// When all 2 downloads have been attempted then resolve the promise.
|
||||
let finishedAllDownloads = new Promise( (resolve) => {
|
||||
downloadView = {
|
||||
onDownloadAdded: function (aDownload) {
|
||||
onDownloadAdded: function(aDownload) {
|
||||
downloads.push(aDownload);
|
||||
if (downloads.length == 2) {
|
||||
resolve();
|
||||
|
|
|
@ -183,7 +183,7 @@ function test() {
|
|||
waitForExplicitFinish();
|
||||
|
||||
gTestWin = openDialog(location, "", "chrome,all,dialog=no", "about:blank");
|
||||
whenDelayedStartupFinished(gTestWin, function () {
|
||||
whenDelayedStartupFinished(gTestWin, function() {
|
||||
info("Browser window opened");
|
||||
waitForFocus(function() {
|
||||
info("Browser window focused");
|
||||
|
@ -199,7 +199,7 @@ function test() {
|
|||
|
||||
// Click handler used to steal click events.
|
||||
var gClickHandler = {
|
||||
handleEvent: function (event) {
|
||||
handleEvent: function(event) {
|
||||
let linkId = event.target.id || event.target.localName;
|
||||
is(event.type, "click",
|
||||
gCurrentTest.desc + ":Handler received a click event on " + linkId);
|
||||
|
@ -230,7 +230,7 @@ var gClickHandler = {
|
|||
|
||||
// Wraps around the methods' replacement mock function.
|
||||
function wrapperMethod(aInvokedMethods, aMethodName) {
|
||||
return function () {
|
||||
return function() {
|
||||
aInvokedMethods.push(aMethodName);
|
||||
// At least getShortcutOrURIAndPostData requires to return url
|
||||
return (aMethodName == "getShortcutOrURIAndPostData") ? arguments.url : arguments[0];
|
||||
|
@ -242,7 +242,7 @@ function setupTestBrowserWindow() {
|
|||
gTestWin.addEventListener("click", gClickHandler, true);
|
||||
|
||||
// Replace methods.
|
||||
gReplacedMethods.forEach(function (aMethodName) {
|
||||
gReplacedMethods.forEach(function(aMethodName) {
|
||||
gTestWin["old_" + aMethodName] = gTestWin[aMethodName];
|
||||
gTestWin[aMethodName] = wrapperMethod(gInvokedMethods, aMethodName);
|
||||
});
|
||||
|
@ -297,7 +297,7 @@ function finishTest() {
|
|||
gTestWin.removeEventListener("click", gClickHandler, true);
|
||||
|
||||
// Restore original methods.
|
||||
gReplacedMethods.forEach(function (aMethodName) {
|
||||
gReplacedMethods.forEach(function(aMethodName) {
|
||||
gTestWin[aMethodName] = gTestWin["old_" + aMethodName];
|
||||
delete gTestWin["old_" + aMethodName];
|
||||
});
|
||||
|
|
|
@ -660,7 +660,7 @@ function setUp(aNoEngine) {
|
|||
});
|
||||
}
|
||||
|
||||
function msg(type, data=null) {
|
||||
function msg(type, data = null) {
|
||||
gMsgMan.sendAsyncMessage(TEST_MSG, {
|
||||
type: type,
|
||||
data: data,
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче