Permalink
Browse files

Going restartless-only

  • Loading branch information...
1 parent 4c7f4ed commit c702b5b7ce8611f4ac331ceec85786511a1b8e8f @cfinke committed Apr 16, 2012
@@ -1,109 +0,0 @@
-var TUBESTOP = {
- load : function () {
- removeEventListener("load", TUBESTOP.load, false);
-
- var firefoxBrowser = document.getElementById("appcontent");
-
- if (firefoxBrowser) {
- firefoxBrowser.addEventListener("DOMContentLoaded", TUBESTOP.DOMContentLoaded, false);
- }
-
- var fennecBrowser = document.getElementById("browsers");
-
- if (fennecBrowser) {
- fennecBrowser.addEventListener("load", TUBESTOP.DOMContentLoaded, true);
- }
-
- addEventListener("unload", TUBESTOP.unload, false);
- },
-
- unload : function () {
- removeEventListener("unload", TUBESTOP.unload, false);
-
- var firefoxBrowser = document.getElementById("appcontent");
-
- if (firefoxBrowser) {
- firefoxBrowser.removeEventListener("DOMContentLoaded", TUBESTOP.DOMContentLoaded, false);
- }
-
- var fennecBrowser = document.getElementById("browsers");
-
- if (fennecBrowser) {
- fennecBrowser.removeEventListener("load", TUBESTOP.DOMContentLoaded, true);
- }
- },
-
- DOMContentLoaded : function (event) {
- var page = event.target;
-
- if ((page.location.protocol == "http:")||(page.location.protocol == "https:")){
- const isYoutube = /(\w*\.)?youtube\.com$/i;
-
- if (!isYoutube.test(page.location.host)) {
- TUBESTOP.checkForYouTubeEmbeds(page);
- return;
- }
- }
- else {
- return;
- }
-
- var playerDiv = page.getElementById("watch-player");
-
- if (playerDiv) {
- var code = playerDiv.innerHTML;
-
- playerDiv.innerHTML = "";
-
- var a = page.createElement("a");
- a.setAttribute("href", "javascript:void(0);");
- a.addEventListener("click", function () { this.parentNode.innerHTML = code; }, false);
- a.addEventListener("mouseover", function () { this.style.backgroundColor = "#eee"; }, false);
- a.addEventListener("mouseout", function () { this.style.backgroundColor = "#fff"; }, false);
- a.style.display = "block";
- a.style.paddingTop = "180px";
- a.style.paddingBottom = "180px";
- a.style.width = "640px";
- a.style.fontSize = "12pt";
- a.style.textAlign = "center";
- a.style.border = "1px dotted gray";
- a.style.background = "#fff";
- a.innerHTML = "Click to play, courtesy of TubeStop.";
-
- playerDiv.appendChild(a);
- }
- },
-
- checkForYouTubeEmbeds : function (page) {
- var params = page.getElementsByTagName("param");
-
- for (var i = 0; i < params.length; i++){
- var param = params[i];
- var value = param.getAttribute("value");
-
- if (value && value.match(/youtube\.com.*autoplay=1/i)){
- param.setAttribute("value",value.replace(/&autoplay=1/i,""));
- param.parentNode.innerHTML = param.parentNode.innerHTML;
- }
- }
-
- var embeds = page.getElementsByTagName("embed");
-
- for (var i = 0; i < embeds.length; i++){
- var embed = embeds[i];
- var src = embed.getAttribute("src");
-
- if (src.match(/youtube\.com.*autoplay=1/i)){
- embed.setAttribute("src",src.replace(/&autoplay=1/i,""));
- embed.parentNode.innerHTML = embed.parentNode.innerHTML;
- }
- }
-
- return;
- },
-
- log : function (message) {
- var consoleService = Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService);
- consoleService.logStringMessage("TUBESTOP: " + message);
- }
-};
@@ -1,11 +0,0 @@
-<?xml version="1.0"?>
-<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/x-javascript" src="chrome://tubestop/content/overlay.js"></script>
- <script type="application/x-javascript">
- <![CDATA[
-
- addEventListener("load", TUBESTOP.load, false);
-
- ]]>
- </script>
-</overlay>
Deleted file not rendered
View
@@ -4,7 +4,7 @@
<em:id>tubestop@efinke.com</em:id>
<em:name>TubeStop</em:name>
<em:bootstrap>true</em:bootstrap>
- <em:version>4</em:version>
+ <em:version>5pre</em:version>
<em:description>Stops the auto-play of YouTube videos.</em:description>
<em:creator>Christopher Finke</em:creator>
<em:homepageURL>http://www.chrisfinke.com/addons/tubestop/</em:homepageURL>
@@ -15,20 +15,9 @@
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
- <em:minVersion>2.0</em:minVersion>
- <em:maxVersion>6.0a1</em:maxVersion>
+ <em:minVersion>4.0</em:minVersion>
+ <em:maxVersion>12.*</em:maxVersion>
</Description>
</em:targetApplication>
-
- <!-- Fennec -->
-
- <em:targetApplication>
- <Description>
- <em:id>{a23983c0-fd0e-11dc-95ff-0800200c9a66}</em:id>
- <em:minVersion>1.0</em:minVersion>
- <em:maxVersion>4.0.*</em:maxVersion>
- </Description>
- </em:targetApplication>
-
</Description>
</RDF>

0 comments on commit c702b5b

Please sign in to comment.