PK
L!0vv
install.jsvar Ext = new Object();
Ext.name = "Paste IP";
Ext.version = "1.0";
Ext.packageName = "pasteip";
Ext.author = "Michael Newton";
Ext.locale = "en-US";
Ext.packageKey = "/" + Ext.author + "/" + Ext.packageName;
Ext.jarFile = Ext.packageName + ".jar";
Ext.contentPath = "content/" + Ext.packageName + "/";
Ext.localePath = "locale/" + Ext.locale + "/" + Ext.packageName + "/";
initInstall(Ext.name, Ext.packageKey, Ext.version);
var regFolder = getFolder("Chrome"), regFlag = DELAYED_CHROME;
setPackageFolder(regFolder);
var err = addFile(Ext.jarFile);
if(err == SUCCESS) {
var regSource = getFolder(regFolder, Ext.jarFile);
registerChrome(CONTENT | regFlag, regSource, Ext.contentPath);
registerChrome(LOCALE | regFlag, regSource, Ext.localePath);
err = performInstall();
if(err == SUCCESS | err == REBOOT_NEEDED) {
alert(Ext.name + " " + Ext.version + " has been succesfully installed.\n"
+"Please restart your browser before continuing.");
} else {
alert("Install failed. Error code:" + err);
cancelInstall(err);
}
} else {
alert("Failed to create " + Ext.jarFile + "\nError code:" + err);
cancelInstall(err);
}
PK
R!0Q pasteip.jarPK
L!0 content/PK
L!0 content/pasteip/PK
/]|R R content/pasteip/contents.rdf
chrome://pasteip/content/pasteipOverlay.xul
PK
TQ!0h^
content/pasteip/pasteip.jsvar pasteip = {
init: function() {
var menu = document.getElementById('contentAreaContextMenu');
menu.addEventListener('popupshowing', pasteip.showHide, false);
},
showHide: function() {
document.getElementById('context-pasteip').hidden = document.getElementById('context-undo').hidden;
document.getElementById('context-pasteua').hidden = document.getElementById('context-undo').hidden;
},
//
// Thanks to mozillazine forum user Torisugari for pointing me to this XPCOM interface as an alternative to using Java!
//
pasteAddress: function() {
var DNSService=Components.classes["@mozilla.org/network/dns-service;1"].getService(Components.interfaces.nsIDNSService);
var theAddress = DNSService.myIPAddress;
var theBox = document.commandDispatcher.focusedElement;
theBox.value = theBox.value + theAddress;
},
pasteUA: function() {
var ua = navigator.userAgent;
var theBox = document.commandDispatcher.focusedElement;
theBox.value = theBox.value + ua;
}
}
window.addEventListener('load', pasteip.init, false);
PK
/>tA A " content/pasteip/pasteipOverlay.xul
PK
L!0 locale/PK
L!0
locale/en-CA/PK
L!0 locale/en-CA/pasteip/PK
/<} ! locale/en-CA/pasteip/contents.rdf
PK
/˻E locale/en-CA/pasteip/pasteip.dtd
PK
L!0
locale/en-US/PK
L!0 locale/en-US/pasteip/PK
/wt ! locale/en-US/pasteip/contents.rdf
PK
/˻E locale/en-US/pasteip/pasteip.dtd
PK
L!0 A content/PK
L!0 A&