diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-15 11:43:52 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-15 11:43:52 +0200 |
commit | 60d29fb2861768032b831b77541e06de03b6ded2 (patch) | |
tree | 138194a1dfbf1f1bb8f1adc3088ff9afa678e3e4 /application/palemoon/base/content/tabbrowser.xml | |
parent | 3c93fde763c87eaaa655a517cc93faa895415185 (diff) | |
download | UXP-60d29fb2861768032b831b77541e06de03b6ded2.tar UXP-60d29fb2861768032b831b77541e06de03b6ded2.tar.gz UXP-60d29fb2861768032b831b77541e06de03b6ded2.tar.lz UXP-60d29fb2861768032b831b77541e06de03b6ded2.tar.xz UXP-60d29fb2861768032b831b77541e06de03b6ded2.zip |
Bug 92737 - Part 4: Open multiple tabs when multiple items are dropped on tab
+ Follow up:
Bug 92737 - Part 3: Open multiple tabs when multiple items are dropped
on remote content area
- browser.js: "usercontextid" (default: 0)
Diffstat (limited to 'application/palemoon/base/content/tabbrowser.xml')
-rw-r--r-- | application/palemoon/base/content/tabbrowser.xml | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml index 0d9c29395..69d824fd5 100644 --- a/application/palemoon/base/content/tabbrowser.xml +++ b/application/palemoon/base/content/tabbrowser.xml @@ -4503,40 +4503,35 @@ this.tabbrowser.updateCurrentBrowser(true); } else { // Pass true to disallow dropping javascript: or data: urls - let url; + let links; try { - url = browserDragAndDrop.drop(event, { }, true); + links = browserDragAndDrop.dropLinks(event, true); } catch (ex) {} // // valid urls don't contain spaces ' '; if we have a space it isn't a valid url. // if (!url || url.includes(" ")) //PMed - if (!url) //FF + if (!links || links.length === 0) //FF return; - let bgLoad = Services.prefs.getBoolPref("browser.tabs.loadInBackground"); + let inBackground = Services.prefs.getBoolPref("browser.tabs.loadInBackground"); if (event.shiftKey) - bgLoad = !bgLoad; + inBackground = !inBackground; - let tab = this._getDragTargetTab(event); - if (!tab || dropEffect == "copy") { - // We're adding a new tab. - let newIndex = this._getDropIndex(event); - let newTab = this.tabbrowser.loadOneTab(url, {inBackground: bgLoad, allowThirdPartyFixup: true}); - this.tabbrowser.moveTabTo(newTab, newIndex); - } else { - // Load in an existing tab. - try { - let webNav = Ci.nsIWebNavigation; - let flags = webNav.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP | - webNav.LOAD_FLAGS_FIXUP_SCHEME_TYPOS; - this.tabbrowser.getBrowserForTab(tab).loadURIWithFlags(url, flags); - if (!bgLoad) - this.selectedItem = tab; - } catch(ex) { - // Just ignore invalid urls - } - } + let targetTab = this._getDragTargetTab(event); + let userContextId = this.selectedItem + .getAttribute("usercontextid") || 0; + let replace = !(!tab || dropEffect == "copy"); + let newIndex = this._getDropIndex(event); + let urls = links.map(link => link.url); + this.tabbrowser.loadTabs(urls, { + inBackground, + replace, + allowThirdPartyFixup: true, + targetTab, + newIndex, + userContextId, + }); } if (draggedTab) { |