diff --git a/chrome.manifest b/chrome.manifest index c51e6b3e..96ca3225 100644 --- a/chrome.manifest +++ b/chrome.manifest @@ -1,6 +1,7 @@ content treestyletab jar:chrome/treestyletab.jar!/content/treestyletab/ overlay chrome://browser/content/browser.xul chrome://treestyletab/content/treestyletab.xul +overlay chrome://global/content/viewSource.xul chrome://treestyletab/content/viewSourceOverlay.xul overlay chrome://multipletab/content/config.xul chrome://treestyletab/content/multipletabConfigOverlay.xul locale treestyletab en-US jar:chrome/treestyletab.jar!/locale/en-US/treestyletab/ diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index ac6aa21b..e7d1adc7 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -800,6 +800,69 @@ catch(e) { openUILinkIn(]]> ) ); + eval('nsContextMenu.prototype.viewPartialSource = '+ + nsContextMenu.prototype.viewPartialSource.toSource().replace( + 'window.openDialog(', + <> + ) + ); + eval('nsContextMenu.prototype.viewFrameSource = '+ + nsContextMenu.prototype.viewFrameSource.toSource().replace( + '{', + <> + ) + ); + eval('window.BrowserViewSourceOfDocument = '+ + window.BrowserViewSourceOfDocument.toSource().replace( + 'ViewSourceOfURL(', + <> + ) + ); + eval('window.ViewSourceOfURL = '+ + window.ViewSourceOfURL.toSource().replace( + 'gViewSourceUtils.openInExternalEditor(', + <> + ) + ); + eval('gViewSourceUtils.openInInternalViewer = '+ + gViewSourceUtils.openInInternalViewer.toSource().replace( + /(openDialog\([^\)]+\))/, + <> + ) + ); funcs = 'handleLinkClick __splitbrowser__handleLinkClick __ctxextensions__handleLinkClick'.split(' '); for (var i in funcs) @@ -839,8 +902,8 @@ catch(e) { ) ); - eval('window.nsBrowserAccess.prototype.openURI = '+ - window.nsBrowserAccess.prototype.openURI.toSource().replace( + eval('nsBrowserAccess.prototype.openURI = '+ + nsBrowserAccess.prototype.openURI.toSource().replace( /switch\s*\(aWhere\)/, <> + + + + + diff --git a/defaults/preferences/treestyletab.js b/defaults/preferences/treestyletab.js index 4d60bf78..e139bfe3 100644 --- a/defaults/preferences/treestyletab.js +++ b/defaults/preferences/treestyletab.js @@ -11,6 +11,7 @@ pref("extensions.treestyletab.show.openSelectionLinks", true); pref("extensions.treestyletab.openGroupBookmarkAsTabSubTree", true); pref("extensions.treestyletab.loadDroppedLinkToNewChildTab", false); +pref("extensions.treestyletab.viewSourceInTab", true); pref("extensions.treestyletab.autoCollapseExpandSubTreeOnSelect", true); pref("extensions.treestyletab.collapseExpandSubTree.dblclick", false);