diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-08-17 22:30:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-17 22:30:46 +0200 |
commit | f36ad080c6f2f13012180dc0ac566893be9020ad (patch) | |
tree | 9d4696de3f3459fa310543b545d42cef2ad77b68 /application/palemoon/base/content/nsContextMenu.js | |
parent | bfc5b53cf96981013beed35d603658631da4686f (diff) | |
parent | 7dd67ceb0ac117932c05a6c37cc1e64766c3b877 (diff) | |
download | UXP-f36ad080c6f2f13012180dc0ac566893be9020ad.tar UXP-f36ad080c6f2f13012180dc0ac566893be9020ad.tar.gz UXP-f36ad080c6f2f13012180dc0ac566893be9020ad.tar.lz UXP-f36ad080c6f2f13012180dc0ac566893be9020ad.tar.xz UXP-f36ad080c6f2f13012180dc0ac566893be9020ad.zip |
Merge pull request #712 from JustOff/PR_viewPartialSource
[PALEMOON] Align viewPartialSource with the UXP codebase
Diffstat (limited to 'application/palemoon/base/content/nsContextMenu.js')
-rw-r--r-- | application/palemoon/base/content/nsContextMenu.js | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/application/palemoon/base/content/nsContextMenu.js b/application/palemoon/base/content/nsContextMenu.js index 19b2fac77..1d4f88816 100644 --- a/application/palemoon/base/content/nsContextMenu.js +++ b/application/palemoon/base/content/nsContextMenu.js @@ -838,30 +838,8 @@ nsContextMenu.prototype = { // View Partial Source viewPartialSource: function(aContext) { - var focusedWindow = document.commandDispatcher.focusedWindow; - if (focusedWindow == window) - focusedWindow = content; - - var docCharset = null; - if (focusedWindow) - docCharset = "charset=" + focusedWindow.document.characterSet; - - // "View Selection Source" and others such as "View MathML Source" - // are mutually exclusive, with the precedence given to the selection - // when there is one - var reference = null; - if (aContext == "selection") - reference = focusedWindow.getSelection(); - else if (aContext == "mathml") - reference = this.target; - else - throw "not reached"; - - // unused (and play nice for fragments generated via XSLT too) - var docUrl = null; - window.openDialog("chrome://global/content/viewPartialSource.xul", - "_blank", "scrollbars,resizable,chrome,dialog=no", - docUrl, docCharset, reference, aContext); + let target = aContext == "mathml" ? this.target : null; + top.gViewSourceUtils.viewPartialSourceInBrowser(gBrowser.selectedBrowser, target); }, // Open new "view source" window with the frame's URL. |