mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-30 04:17:31 +09:00
[PALEMOON] Align viewPartialSource with the UXP codebase
This commit is contained in:
parent
4debc9246e
commit
8ad5a057d1
1 changed files with 2 additions and 24 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue