-
Notifications
You must be signed in to change notification settings - Fork 43
/
background.js
4 lines (4 loc) · 1.43 KB
/
background.js
1
2
3
4
/* Automatically generated file. Do not edit directly.
Copyright (C) 2019 Gab AI, Inc.
All Rights Reserved */
var BROWSER_CONFIG={name:"Google Chrome",slug:"chrome",version:"0.1.3"},BROWSER_CHROME_SLUG="chrome",BROWSER_FIREFOX_SLUG="firefox",BROWSER_EDGE_SLUG="edge",BROWSER_SAFARI_SLUG="safari",BASE_URI="https://dissenter.com/discussion/begin-extension?url=",BACKGROUND_ACTION_OPEN_POPUP="open_popup",COLOR_GAB_GREEN="#21cf7b",isObject=function(e){return!isArray(e)&&!isDate(e)&&(null!==e&&"object"==typeof e)},isString=function(e){return"string"==typeof e||e instanceof String},isDate=function(e){return!isString(e)&&!isArray(e)&&null!=e&&null!=e&&(e&&"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e))},isArray=function(e){return Array.isArray(e)};function ready(e){var n=document;"loading"==n.readyState?n.addEventListener("DOMContentLoaded",e):e()}function getQueryStringValue(e){return decodeURIComponent(window.location.search.replace(new RegExp("^(?:.*[&\\?]"+encodeURIComponent(e).replace(/[\.\+\*]/g,"\\$&")+"(?:\\=([^&]*))?)?.*$","i"),"$1"))}chrome.browserAction.onClicked.addListener(function(){chrome.tabs.create({url:"index.html"})}),chrome.runtime.onMessage.addListener(function(e,n,t){if((e.action||"")===BACKGROUND_ACTION_OPEN_POPUP){var r=e.url||"",o=e.height||0,i=screen.width,c=screen.height-o,a=chrome.extension.getURL("popup/popup.html?url="+r);chrome.windows.create({url:a,width:420,height:o,top:c,left:i,type:"popup"})}return!0});