summaryrefslogtreecommitdiffstats
path: root/application/palemoon/base/content/openLocation.js
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-04-28 17:57:18 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-04-28 17:57:18 +0200
commitf69729b0aa1d8cd1964994919ab30ce7c7d9f410 (patch)
treed877e04983b628a9e45271615fc9486712e4a404 /application/palemoon/base/content/openLocation.js
parentb53db93006f732fb2e140137e4713dedca1700d9 (diff)
parentde057c7a5635e65f45ce47162d226b1ddf24e8aa (diff)
downloadUXP-f69729b0aa1d8cd1964994919ab30ce7c7d9f410.tar
UXP-f69729b0aa1d8cd1964994919ab30ce7c7d9f410.tar.gz
UXP-f69729b0aa1d8cd1964994919ab30ce7c7d9f410.tar.lz
UXP-f69729b0aa1d8cd1964994919ab30ce7c7d9f410.tar.xz
UXP-f69729b0aa1d8cd1964994919ab30ce7c7d9f410.zip
Merge branch 'master' of https://github.com/MoonchildProductions/UXP
Diffstat (limited to 'application/palemoon/base/content/openLocation.js')
-rw-r--r--application/palemoon/base/content/openLocation.js77
1 files changed, 42 insertions, 35 deletions
diff --git a/application/palemoon/base/content/openLocation.js b/application/palemoon/base/content/openLocation.js
index 316dfac70..1a10334c7 100644
--- a/application/palemoon/base/content/openLocation.js
+++ b/application/palemoon/base/content/openLocation.js
@@ -61,45 +61,52 @@ function doEnabling()
function open()
{
- var url;
- var postData = {};
- var mayInheritPrincipal = {value: false};
- if (browser)
- url = browser.getShortcutOrURI(dialog.input.value, postData, mayInheritPrincipal);
- else
- url = dialog.input.value;
+ getShortcutOrURIAndPostData(dialog.input.value).then(data => {
+ let url;
+ let postData = null;
+ let mayInheritPrincipal = false;
+
+ if (browser) {
+ url = data.url;
+ postData = data.postData;
+ mayInheritPrincipal = data.mayInheritPrincipal;
+ } else {
+ url = dialog.input.value;
+ }
- try {
- // Whichever target we use for the load, we allow third-party services to
- // fixup the URI
- switch (dialog.openWhereList.value) {
- case "0":
- var webNav = Components.interfaces.nsIWebNavigation;
- var flags = webNav.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP |
- webNav.LOAD_FLAGS_FIXUP_SCHEME_TYPOS;
- if (!mayInheritPrincipal.value)
- flags |= webNav.LOAD_FLAGS_DISALLOW_INHERIT_OWNER;
- browser.gBrowser.loadURIWithFlags(url, flags, null, null, postData.value);
- break;
- case "1":
- window.opener.delayedOpenWindow(getBrowserURL(), "all,dialog=no",
- url, postData.value, null, null, true);
- break;
- case "3":
- browser.delayedOpenTab(url, null, null, postData.value, true);
- break;
+ try {
+ // Whichever target we use for the load, we allow third-party services to
+ // fixup the URI
+ switch (dialog.openWhereList.value) {
+ case "0":
+ var webNav = Components.interfaces.nsIWebNavigation;
+ var flags = webNav.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP |
+ webNav.LOAD_FLAGS_FIXUP_SCHEME_TYPOS;
+ if (!mayInheritPrincipal)
+ flags |= webNav.LOAD_FLAGS_DISALLOW_INHERIT_OWNER;
+ browser.gBrowser.loadURIWithFlags(url, flags, null, null, postData);
+ break;
+ case "1":
+ window.opener.delayedOpenWindow(getBrowserURL(), "all,dialog=no",
+ url, postData, null, null, true);
+ break;
+ case "3":
+ browser.delayedOpenTab(url, null, null, postData, true);
+ break;
+ }
+ }
+ catch(exception) {
}
- }
- catch(exception) {
- }
- if (pref) {
- gOpenLocationLastURL.value = dialog.input.value;
- pref.setIntPref("general.open_location.last_window_choice", dialog.openWhereList.value);
- }
+ if (pref) {
+ gOpenLocationLastURL.value = dialog.input.value;
+ pref.setIntPref("general.open_location.last_window_choice", dialog.openWhereList.value);
+ }
+
+ // Delay closing slightly to avoid timing bug on Linux.
+ window.close();
+ });
- // Delay closing slightly to avoid timing bug on Linux.
- window.close();
return false;
}