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