summaryrefslogtreecommitdiffstats
path: root/application/palemoon/base/content/browser.js
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-15 09:48:39 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-15 09:48:39 +0200
commit451cbfc0393ee0f3b8d18f856e6c8ad88d57b172 (patch)
tree0c62961b5b85901abf8883356562baee88fb63e3 /application/palemoon/base/content/browser.js
parentf2b4134845cb61831847e6746de2f15051d65a08 (diff)
downloadUXP-451cbfc0393ee0f3b8d18f856e6c8ad88d57b172.tar
UXP-451cbfc0393ee0f3b8d18f856e6c8ad88d57b172.tar.gz
UXP-451cbfc0393ee0f3b8d18f856e6c8ad88d57b172.tar.lz
UXP-451cbfc0393ee0f3b8d18f856e6c8ad88d57b172.tar.xz
UXP-451cbfc0393ee0f3b8d18f856e6c8ad88d57b172.zip
Bug 1100291 - Make getShortcutOrURIAndPostData() async by calling the passed callback off a zero timeout
Issue #112
Diffstat (limited to 'application/palemoon/base/content/browser.js')
-rw-r--r--application/palemoon/base/content/browser.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js
index 154badae5..be7993961 100644
--- a/application/palemoon/base/content/browser.js
+++ b/application/palemoon/base/content/browser.js
@@ -1906,6 +1906,12 @@ function getShortcutOrURIAndPostData(aURL, aCallback) {
let keyword = aURL;
let param = "";
+ // XXX Bug 1100294 will remove this little hack by using an async version of
+ // PlacesUtils.getURLAndPostDataForKeyword(). For now we simulate an async
+ // execution with at least a setTimeout(fn, 0).
+ let originalCallback = aCallback;
+ aCallback = data => setTimeout(() => originalCallback(data));
+
let offset = aURL.indexOf(" ");
if (offset > 0) {
keyword = aURL.substr(0, offset);