Skip to content

Commit

Permalink
Import sources form local repo
Browse files Browse the repository at this point in the history
  • Loading branch information
JustOff committed Sep 7, 2017
0 parents commit d5ae16a
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 0 deletions.
2 changes: 2 additions & 0 deletions chrome.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
content vstab ./
overlay chrome://browser/content/browser.xul chrome://vstab/content/vstab.xul
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions install.rdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version='1.0' encoding='utf-8'?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>vstab@Off.JustOff</em:id>
<em:name>View Source In Tab</em:name>
<em:version>1.0.2</em:version>
<em:description>View Source in Tab</em:description>
<em:creator>JustOff</em:creator>
<em:contributor>Brian King</em:contributor>
<em:contributor>WYSIWYG Classic Icons by dryicons (http://dryicons.com/)</em:contributor>
<em:updateURL>https://localhost/update.xml</em:updateURL>

<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>24.0</em:minVersion>
<em:maxVersion>*</em:maxVersion>
</Description>
</em:targetApplication>
<em:targetApplication>
<Description>
<em:id>{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}</em:id>
<em:minVersion>24.0</em:minVersion>
<em:maxVersion>*</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
</RDF>
20 changes: 20 additions & 0 deletions vstab.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
var vstabClass =
{
InterceptVS: function ()
{
var page = content.location.href;
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var uri = ioService.newURI(page, null, null);
var proto = uri.scheme;

if (proto != "view-source") {
openUILinkIn("view-source:"+uri.spec, "tab");
}
},

BrowserViewSourceOfDocument: function (aDocument)
{
openUILinkIn("view-source:"+aDocument.location.href, "tab");
}
};
30 changes: 30 additions & 0 deletions vstab.xul
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0"?>

<!DOCTYPE overlay [
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd" >
%browserDTD;
]>

<overlay id="vstabOverlay"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:nc="http://home.netscape.com/NC-rdf#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<script type="application/x-javascript" src="chrome://vstab/content/vstab.js"/>

<stringbundleset id="stringbundleset">
<stringbundle id="viewSourceBundle" src="chrome://global/locale/viewSource.properties"/>
</stringbundleset>

<commandset id="mainCommandSet">
<command id="View:PageSource" oncommand="vstabClass.InterceptVS();" observes="isImage"/>
</commandset>

<popup id="contentAreaContextMenu">
<menuitem id="context-viewsource"
insertbefore="context-viewinfo"
label="&viewPageSourceCmd.label;"
accesskey=""
oncommand="vstabClass.BrowserViewSourceOfDocument(content.document);"/>
</popup>
</overlay>

0 comments on commit d5ae16a

Please sign in to comment.