mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1067325 - Allow DevTools to use view source in tab. r=jsantell
This commit is contained in:
parent
6e6443b342
commit
f4f438183c
@ -123,6 +123,15 @@ exports.viewSourceInScratchpad = Task.async(function *(sourceURL, sourceLine) {
|
||||
* @return {Promise}
|
||||
*/
|
||||
exports.viewSource = Task.async(function *(toolbox, sourceURL, sourceLine) {
|
||||
// Attempt to access view source via a browser first, which may display it in
|
||||
// a tab, if enabled.
|
||||
let browserWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
if (browserWin) {
|
||||
return browserWin.BrowserViewSourceOfDocument({
|
||||
URL: sourceURL,
|
||||
lineNumber: sourceLine
|
||||
});
|
||||
}
|
||||
let utils = toolbox.gViewSourceUtils;
|
||||
utils.viewSource(sourceURL, null, toolbox.doc, sourceLine || 0);
|
||||
});
|
||||
|
@ -434,6 +434,15 @@ WebConsole.prototype = {
|
||||
* The line number which should be highlighted.
|
||||
*/
|
||||
viewSource: function WC_viewSource(aSourceURL, aSourceLine) {
|
||||
// Attempt to access view source via a browser first, which may display it in
|
||||
// a tab, if enabled.
|
||||
let browserWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
if (browserWin) {
|
||||
return browserWin.BrowserViewSourceOfDocument({
|
||||
URL: aSourceURL,
|
||||
lineNumber: aSourceLine
|
||||
});
|
||||
}
|
||||
this.gViewSourceUtils.viewSource(aSourceURL, null, this.iframeWindow.document, aSourceLine || 0);
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user