-
Notifications
You must be signed in to change notification settings - Fork 43
/
popup.js
1 lines (1 loc) · 1.1 KB
/
popup.js
1
var t={name:"Microsoft Edge",slug:"edge",scriptVariableMap:{BROWSER:"browser",MESSENGER:"runtime"},manifestMap:{"background.persistent":!1,version:"0.1.1"},version:"0.1.1"},e="chrome",n="firefox",i="edge",r="safari",o="https://dissenter.com/discussion/begin-extension?url=",u=function(e){return!c(e)&&!a(e)&&(null!==e&&"object"==typeof e)},s=function(e){return"string"==typeof e||e instanceof String},a=function(e){return!s(e)&&!c(e)&&null!=e&&null!=e&&(e&&"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e))},c=function(e){return Array.isArray(e)},d=function(){document.body,document.getElementById("popup");var i=document.getElementById("popup-iframe");function n(e,n){n,setTimeout(function(){var e=encodeURIComponent(n),t=o+e;i.setAttribute("src",t),i.classList.remove("hidden")},250)}this.init=function(){if(t.slug===r){var e=safari.application.activeBrowserWindow.activeTab;u(e)||(e={});e.title;n(0,e.url||"")}else browser.tabs.query({active:!0,currentWindow:!0},function(e){if(!e)return!1;var t=e[0]||{};t.title;n(0,t.url||"")})}};document.addEventListener("DOMContentLoaded",function(){(new d).init()});