Here's some links I used for my development:
- http://kb.mozillazine.org/Getting_started_with_extension_development
- https://developer.mozilla.org/en/Building_an_Extension
- http://ted.mielczarek.org/code/mozilla/extensionwiz/
- https://developer.mozilla.org/en/Working_with_windows_in_chrome_code#Accessing_content_documents
- http://www.viikii.net/videos/watch/2061
- http://www.viikii.net/viewer/viikiiplayer2.swf?video_id=994
- https://developer.mozilla.org/En/DOM/Window
I would recommend starting off with the extensionwiz link to create the stubs for you, then modify the icon.png and overlay.js to suit your needs. Took me about 1.5 days to learn it and get it up and running.
By the way, you put the link file in the profile folder that looks something like (Linux):
~/.mozilla/firefox/17jmqswm.default/extensions
Tried to upload the file, no luck and I'm too lazy to put it elsewhere :(
but here's the code
var newURL = content.document.URL;
var separator = "=";
var urlArray = newURL.split(separator);
var isFirstURL = (urlArray.length == 2) ? true : false;
var vidId = urlArray[urlArray.length-1];
var isFound = /^-?\d+$/.test(vidId);
if (isFound) {
++vidId;
// build the new URL, case 2
newURL = "";
for (var i = 0; i <>
newURL += urlArray[i] + separator;
}
newURL += vidId;
//promptService.alert(window, this.strings.getString("errorTitle"),"url="+newURL);
var strWindowFeatures = "toolbar=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes,fullscreen=yes";
var windowObjectReference = window.open(newURL, "Viikii.net " + vidId, strWindowFeatures);
window.close();
} else {
promptService.alert(window, this.strings.getString("errorTitle"),
this.strings.getString("errorMessage") +
" '" + newURL + "' ");
}
No comments:
Post a Comment