diff --git a/Plugins/AutoPlayGifs.plugin.js b/Plugins/AutoPlayGifs.plugin.js index 356acfd..fb9126b 100644 --- a/Plugins/AutoPlayGifs.plugin.js +++ b/Plugins/AutoPlayGifs.plugin.js @@ -3,27 +3,17 @@ var agif = function () {}; agif.prototype.convert = function () { - $(".attachment-image").each(function() { - var href = $(this).find("canvas").attr("href"); + $(".image canvas").each(function() { + var href = $(this).attr("href"); if(href != undefined) { - $(this).empty(); - $(this).html(''); + if(href.endsWith(".gif")) { + $(this).replaceWith(''); + } } }); - - $(".embed-thumbnail-image").each(function() { - var href = $(this).attr("href"); - if(href != undefined) { - if(href.endsWith(".gif")) { - $(this).empty(); - $(this).html(''); - } - } - }); }; agif.prototype.onMessage = function () { - console.log("ONMESSAGE"); this.convert(); }; agif.prototype.onSwitch = function () { @@ -44,7 +34,7 @@ agif.prototype.getName = function () { return "Autogif"; }; agif.prototype.getDescription = function () { - return "Don't use currently broken."; + return "Autoplay gifs without having to hover."; }; agif.prototype.getVersion = function () { return "0.1.0";