mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-18 21:27:30 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
33
toolkit/content/tests/browser/head.js
Normal file
33
toolkit/content/tests/browser/head.js
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
"use strict";
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Promise",
|
||||
"resource://gre/modules/Promise.jsm");
|
||||
|
||||
/**
|
||||
* A wrapper for the findbar's method "close", which is not synchronous
|
||||
* because of animation.
|
||||
*/
|
||||
function closeFindbarAndWait(findbar) {
|
||||
return new Promise((resolve) => {
|
||||
if (findbar.hidden) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
findbar.addEventListener("transitionend", function cont(aEvent) {
|
||||
if (aEvent.propertyName != "visibility") {
|
||||
return;
|
||||
}
|
||||
findbar.removeEventListener("transitionend", cont);
|
||||
resolve();
|
||||
});
|
||||
findbar.close();
|
||||
});
|
||||
}
|
||||
|
||||
function pushPrefs(...aPrefs) {
|
||||
let deferred = Promise.defer();
|
||||
SpecialPowers.pushPrefEnv({"set": aPrefs}, deferred.resolve);
|
||||
return deferred.promise;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue