12345678910111213141516171819202122232425262728293031323334 |
- browser.storage.sync.get().then(function(settings) {
- if(settings.domain) {
- if(settings.keeptweet) {
- var style = document.createElement("style");
- var link = document.createElement("a");
- var icon = document.createElement("i");
- style.appendChild(document.createTextNode(".label {margin-left:0 !important} .btn {padding-right:6px !important}"));
- document.body.appendChild(style);
- link.className = "btn";
- link.style.marginLeft = "5px";
- link.href = document.getElementById("b").href.replace(/twitter.com\/intent\/tweet/g,settings.domain+"/intent/toot");
- icon.style.backgroundImage = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAGVklEQVRYhZ1XbWxT1xl+49iQBPIByZLcS2ApCKnq2h+dCuVDUZi0jYkVUItAFaVSVaXlR38koAYC2MR2CA1flUYgJCbxtYtotW6Ij1I6TWoRVatCWVJhCLFNNMsxU7aJpSwjQ8l9z3n2417HTmI7yV7plX3vPfc+z33e57z3HKJM4XRayOm0jB+XlORTZVU1ra2po43Ok/TaifP02onztNF5ktbW1FFlVTWVlOSnvX9WsXVr9vj/ypdX0avN7VR7PUKOXpAzBGoMghr7zAwa5xy9oNrrEXq1uZ0qX16V8lmzAlcrn6Xt7RfIFQa5+0H2ACyOAGxNIc5piXDesRjnHYtxTkuEbU0htjgCIHvAGOsKg7a3XyC18tlZkEDW+MCVO2roQGCYXGFQQ4+c4w7qRa1DsqxzFIomofoA1W+mD1A0ibLOURS1Dsk57pBODT2SXGHQgcAwrdxRkyCBrOnffP2+I9QcBe3rgbXxnl7cNgzFZ4CWawLlXka5V0d5l5le3TinCYOMT6K4bRjWxns67esBNUdB6+uPZFZi3TqrAV5/hA4PgBpu6blHB2S5JqD4pAliAmVMY5zikyjXBHKPDkhquKXT4ViCRBxrypu/uO1tao6C9twem/fhoFT9SHrodMCpiDBUPzDvw0FJe26PUXMU9OK2tycq4XRaiJBFpYuXkePOCDV0c+7RARP8/wGeSkT1w1Sim8lxZ4RKFy8jQpaBHWfyettlcj2A1XWflfE6T5+qxlikMSp8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pIo0xr51x1eyEySaU0jBb8seq7vOHknbf1K0fxGD97cHjqRelkxen6+vTLssrfAJzzzCctwRYSDzV5XiNk+PryBOsOd3HtLsb1sPRBHjmvUGmjUlIL2odkuWdoyg6K/HLK1NlfzSi42LvY7nZ38+0p0eSPQyr484TWr1j5wzAUyiRZmtmbQpxXkuEd156yPXXHvJbf4jyurNhLjkUAO0NgOwPYHGHkf2m5xIt/NlzqWs+UxJE6TenDX1G7guCDoRA9l7Y3r8RtW1p8dBPV6xJ+axZRbrt+eqaOstG50nb1hPnbduOf5K9+dBpS/XO3dZl1b+gBQsK096fIv4HRI8A8hJEH2oAAAAASUVORK5CYII=)";
- icon.style.backgroundSize = "cover";
- link.appendChild(icon);
- document.getElementById("l").innerText = "";
- document.getElementsByClassName("btn-o")[0].appendChild(link);
- }
- else {
- document.getElementById("b").href = document.getElementById("b").href.replace(/twitter.com\/intent\/tweet/g,settings.domain+"/intent/toot");
- document.getElementById("l").innerText = "Toot";
- document.getElementsByTagName("i")[0].style.backgroundImage = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAGVklEQVRYhZ1XbWxT1xl+49iQBPIByZLcS2ApCKnq2h+dCuVDUZi0jYkVUItAFaVSVaXlR38koAYC2MR2CA1flUYgJCbxtYtotW6Ij1I6TWoRVatCWVJhCLFNNMsxU7aJpSwjQ8l9z3n2417HTmI7yV7plX3vPfc+z33e57z3HKJM4XRayOm0jB+XlORTZVU1ra2po43Ok/TaifP02onztNF5ktbW1FFlVTWVlOSnvX9WsXVr9vj/ypdX0avN7VR7PUKOXpAzBGoMghr7zAwa5xy9oNrrEXq1uZ0qX16V8lmzAlcrn6Xt7RfIFQa5+0H2ACyOAGxNIc5piXDesRjnHYtxTkuEbU0htjgCIHvAGOsKg7a3XyC18tlZkEDW+MCVO2roQGCYXGFQQ4+c4w7qRa1DsqxzFIomofoA1W+mD1A0ibLOURS1Dsk57pBODT2SXGHQgcAwrdxRkyCBrOn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Ky4G7MutgfBrOoBElZ4WPMfcMw31bTHjD6WLUHKj98FhSfQDZddfNRjTLVqxqjEIP4+bf5XgTmkmwKcMr58I62fth2ZxoxTP+GMXlX+JPMuAMCLDZmG7GRkB7e0S2Owzb0hUrJi5GZvA5VrzGTFh+jvHoqUlgGnAJQBcSQgIrTvUx2cPIfqPjagJ7FguSZAMOjkyvgAQwZkpfe+1vknb9ha3OwH+pYulyIspK7BlmuSQr7WLcHzJAMjWiOLmWG/8A1X0/ZvsgiuxVb7yTenE6w0XpIo0xr51x1eyEySaU0jBb8seq7vOHknbf1K0fxGD97cHjqRelkxen6+vTLssrfAJzzzCctwRYSDzV5XiNk+PryBOsOd3HtLsb1sPRBHjmvUGmjUlIL2odkuWdoyg6K/HLK1NlfzSi42LvY7nZ38+0p0eSPQyr484TWr1j5wzAUyiRZmtmbQpxXkuEd156yPXXHvJbf4jyurNhLjkUAO0NgOwPYHGHkf2m5xIt/NlzqWs+UxJE6TenDX1G7guCDoRA9l7Y3r8RtW1p8dBPV6xJ+axZRbrt+eqaOstG50nb1hPnbduOf5K9+dBpS/XO3dZl1b+gBQsK096fIv4HRI8A8hJEH2oAAAAASUVORK5CYII=)";
- document.getElementsByTagName("i")[0].style.backgroundSize = "cover";
- document.getElementById("b").onclick = function() {};
- }
- }
- else {
- document.getElementById("b").href = browser.runtime.getURL("settings.html");
- document.getElementById("l").innerText = "Config";
- document.getElementsByTagName("i")[0].style.backgroundImage = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAGVklEQVRYhZ1XbWxT1xl+49iQBPIByZLcS2ApCKnq2h+dCuVDUZi0jYkVUItAFaVSVaXlR38koAYC2MR2CA1flUYgJCbxtYtotW6Ij1I6TWoRVatCWVJhCLFNNMsxU7aJpSwjQ8l9z3n2417HTmI7yV7plX3vPfc+z33e57z3HKJM4XRayOm0jB+XlORTZVU1ra2po43Ok/TaifP02onztNF5ktbW1FFlVTWVlOSnvX9WsXVr9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+QdizE19oG2HP94CoHSTh1L/IbJ1l0UWHOBsfJTxgufMJadM2uqMa5E5DhQOhUA4LtBiQKPQUDxpiIwqQTlXh1lXUb9CzyMIo/h5uJOY9opmnG82Md4+MRUIkMpAKClW4BOMVRNR4V/cgnSmDA+A+KpaAk3L/ExbG0Mf9BA0KfxAwC4vhco9DCKu8QkE2aYhilbqpdR2sV45iNG6MdEvTNF/PqfBySWfzQKy4G7MutgfBrOoBElZ4WPMfcMw31bTHjD6WLUHKj98FhSfQDZddfNRjTLVqxqjEIP4+bf5XgTmkmwKcMr58I62fth2ZxoxTP+GMXlX+JPMuAMCLDZmG7GRkB7e0S2Owzb0hUrJi5GZvA5VrzGTFh+jvHoqUlgGnAJQBcSQgIrTvUx2cPIfqPjagJ7FguSZAMOjkyvgAQwZkpfe+1vknb9ha3OwH+pYulyIspK7BlmuSQr7WLcHzJAMjWiOLmWG/8A1X0/ZvsgiuxVb7yTenE6w0XpIo0xr51x1eyEySaU0jBb8seq7vOHknbf1K0fxGD97cHjqRelkxen6+vTLssrfAJzzzCctwRYSDzV5XiNk+PryBOsOd3HtLsb1sPRBHjmvUGmjUlIL2odkuWdoyg6K/HLK1NlfzSi42LvY7nZ38+0p0eSPQyr484TWr1j5wzAUyiRZmtmbQpxXkuEd156yPXXHvJbf4jyurNhLjkUAO0NgOwPYHGHkf2m5xIt/NlzqWs+UxJE6TenDX1G7guCDoRA9l7Y3r8RtW1p8dBPV6xJ+axZRbrt+eqaOstG50nb1hPnbduOf5K9+dBpS/XO3dZl1b+gBQsK096fIv4HRI8A8hJEH2oAAAAASUVORK5CYII=)";
- document.getElementsByTagName("i")[0].style.backgroundSize = "cover";
- document.getElementById("b").onclick = function() {};
- }
- });
|