From 94f797e930f33fddaa7a144ccfad86141289d4dd Mon Sep 17 00:00:00 2001 From: mgabdev <47340266+mgabdev@users.noreply.github.com> Date: Tue, 12 Mar 2019 20:51:58 -0400 Subject: [PATCH] Hotfix - Removed disqus feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Removed: - disqus feature - The "all" content script for edge, firefox, chrome - The all script within gulpfile --- build/chrome/content/all/script/script.js | 4 - build/chrome/manifest.json | 2 +- build/edge/content/all/script/script.js | 4 - build/edge/manifest.json | 2 +- build/firefox/content/all/script/script.js | 4 - build/firefox/manifest.json | 2 +- config/manifest.js | 7 -- gulpfile.js | 1 - src/scripts/content/all/script.js | 127 --------------------- 9 files changed, 3 insertions(+), 150 deletions(-) delete mode 100644 build/chrome/content/all/script/script.js delete mode 100644 build/edge/content/all/script/script.js delete mode 100644 build/firefox/content/all/script/script.js delete mode 100644 src/scripts/content/all/script.js diff --git a/build/chrome/content/all/script/script.js b/build/chrome/content/all/script/script.js deleted file mode 100644 index e9de73c..0000000 --- a/build/chrome/content/all/script/script.js +++ /dev/null @@ -1,4 +0,0 @@ -/* 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(t){return!isArray(t)&&!isDate(t)&&(null!==t&&"object"==typeof t)},isString=function(t){return"string"==typeof t||t instanceof String},isDate=function(t){return!isString(t)&&!isArray(t)&&null!=t&&null!=t&&(t&&"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(t))},isArray=function(t){return Array.isArray(t)};function ready(t){var e=document;"loading"==e.readyState?e.addEventListener("DOMContentLoaded",t):t()}function getQueryStringValue(t){return decodeURIComponent(window.location.search.replace(new RegExp("^(?:.*[&\\?]"+encodeURIComponent(t).replace(/[\.\+\*]/g,"\\$&")+"(?:\\=([^&]*))?)?.*$","i"),"$1"))}var GDAll=function(){var t=function(){function t(){var t=document.getElementById("disqus_thread");if(!t)return!1;var e=function(){var t=document.createElement("div");t.style.setProperty("display","block","important"),t.style.setProperty("width","100%","important"),t.style.setProperty("height","80px","important"),t.style.setProperty("padding","20px 0","important"),t.style.setProperty("overflow","hidden","important"),t.style.setProperty("box-sizing","border-box","important");var e=document.createElement("a");return e.textContent="View Comments on Dissenter",e.style.setProperty("display","block","important"),e.style.setProperty("width","100%","important"),e.style.setProperty("height","40px","important"),e.style.setProperty("background-color",COLOR_GAB_GREEN,"important"),e.style.setProperty("color","#fff","important"),e.style.setProperty("border-radius","4px","important"),e.style.setProperty("text-align","center","important"),e.style.setProperty("margin","0 auto","important"),e.style.setProperty("line-height","40px","important"),e.style.setProperty("font-size","14px","important"),e.style.setProperty("box-sizing","border-box","important"),e.style.setProperty("cursor","pointer","important"),t.appendChild(e),t}();return t.parentElement.insertBefore(e,t),e.onclick=r,!0}function r(){var t=window.location.href,e=window.innerHeight;chrome.runtime.sendMessage({action:BACKGROUND_ACTION_OPEN_POPUP,url:t,height:e})}this.init=function(){t()}};this.init=function(){(new t).init()}};ready(function(){setTimeout(function(){(new GDAll).init()},5e3)}); \ No newline at end of file diff --git a/build/chrome/manifest.json b/build/chrome/manifest.json index c425818..b9ca2f1 100644 --- a/build/chrome/manifest.json +++ b/build/chrome/manifest.json @@ -1 +1 @@ -{"manifest_version":2,"name":"Dissenter Extension","short_name":"Dissenter","description":"Dissenter is the comment section of the Internet.","homepage_url":"https://dissenter.com","icons":{"16":"assets/images/logo/icon-16.png","48":"assets/images/logo/icon-48.png","128":"assets/images/logo/icon-128.png"},"permissions":["activeTab","tabs","https://*.dissenter.com/*"],"browser_action":{"default_icon":"assets/images/logo/icon-128.png","default_popup":"popup/popup.html"},"commands":{"_execute_browser_action":{"suggested_key":{"default":"Alt+Shift+D","mac":"Alt+Shift+D"}}},"background":{"scripts":["background/background.js"],"persistent":false},"content_scripts":[{"matches":["https://*.twitter.com/*"],"js":["content/twitter/script/script.js"]},{"matches":["https://*.youtube.com/*"],"js":["content/youtube/script/script.js"]},{"matches":["https://*.reddit.com/*"],"js":["content/reddit/script/script.js"]},{"matches":["http://*/*","https://*/*"],"js":["content/all/script/script.js"]}],"content_security_policy":"script-src 'self' 'unsafe-eval'; object-src 'self' https://*.dissenter.com/*","incognito":"spanning","offline_enabled":false,"version_name":"0.1.3","version":"0.1.3"} \ No newline at end of file +{"manifest_version":2,"name":"Dissenter Extension","short_name":"Dissenter","description":"Dissenter is the comment section of the Internet.","homepage_url":"https://dissenter.com","icons":{"16":"assets/images/logo/icon-16.png","48":"assets/images/logo/icon-48.png","128":"assets/images/logo/icon-128.png"},"permissions":["activeTab","tabs","https://*.dissenter.com/*"],"browser_action":{"default_icon":"assets/images/logo/icon-128.png","default_popup":"popup/popup.html"},"commands":{"_execute_browser_action":{"suggested_key":{"default":"Alt+Shift+D","mac":"Alt+Shift+D"}}},"background":{"scripts":["background/background.js"],"persistent":false},"content_scripts":[{"matches":["https://*.twitter.com/*"],"js":["content/twitter/script/script.js"]},{"matches":["https://*.youtube.com/*"],"js":["content/youtube/script/script.js"]},{"matches":["https://*.reddit.com/*"],"js":["content/reddit/script/script.js"]}],"content_security_policy":"script-src 'self' 'unsafe-eval'; object-src 'self' https://*.dissenter.com/*","incognito":"spanning","offline_enabled":false,"version_name":"0.1.3","version":"0.1.3"} \ No newline at end of file diff --git a/build/edge/content/all/script/script.js b/build/edge/content/all/script/script.js deleted file mode 100644 index 5317a0c..0000000 --- a/build/edge/content/all/script/script.js +++ /dev/null @@ -1,4 +0,0 @@ -/* Automatically generated file. Do not edit directly. -Copyright (C) 2019 Gab AI, Inc. -All Rights Reserved */ -var BROWSER_CONFIG={name:"Microsoft Edge",slug:"edge",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(t){return!isArray(t)&&!isDate(t)&&(null!==t&&"object"==typeof t)},isString=function(t){return"string"==typeof t||t instanceof String},isDate=function(t){return!isString(t)&&!isArray(t)&&null!=t&&null!=t&&(t&&"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(t))},isArray=function(t){return Array.isArray(t)};function ready(t){var e=document;"loading"==e.readyState?e.addEventListener("DOMContentLoaded",t):t()}function getQueryStringValue(t){return decodeURIComponent(window.location.search.replace(new RegExp("^(?:.*[&\\?]"+encodeURIComponent(t).replace(/[\.\+\*]/g,"\\$&")+"(?:\\=([^&]*))?)?.*$","i"),"$1"))}var GDAll=function(){var t=function(){function t(){var t=document.getElementById("disqus_thread");if(!t)return!1;var e=function(){var t=document.createElement("div");t.style.setProperty("display","block","important"),t.style.setProperty("width","100%","important"),t.style.setProperty("height","80px","important"),t.style.setProperty("padding","20px 0","important"),t.style.setProperty("overflow","hidden","important"),t.style.setProperty("box-sizing","border-box","important");var e=document.createElement("a");return e.textContent="View Comments on Dissenter",e.style.setProperty("display","block","important"),e.style.setProperty("width","100%","important"),e.style.setProperty("height","40px","important"),e.style.setProperty("background-color",COLOR_GAB_GREEN,"important"),e.style.setProperty("color","#fff","important"),e.style.setProperty("border-radius","4px","important"),e.style.setProperty("text-align","center","important"),e.style.setProperty("margin","0 auto","important"),e.style.setProperty("line-height","40px","important"),e.style.setProperty("font-size","14px","important"),e.style.setProperty("box-sizing","border-box","important"),e.style.setProperty("cursor","pointer","important"),t.appendChild(e),t}();return t.parentElement.insertBefore(e,t),e.onclick=r,!0}function r(){var t=window.location.href,e=window.innerHeight;browser.runtime.sendMessage({action:BACKGROUND_ACTION_OPEN_POPUP,url:t,height:e})}this.init=function(){t()}};this.init=function(){(new t).init()}};ready(function(){setTimeout(function(){(new GDAll).init()},5e3)}); \ No newline at end of file diff --git a/build/edge/manifest.json b/build/edge/manifest.json index 5d652ff..fa4e865 100644 --- a/build/edge/manifest.json +++ b/build/edge/manifest.json @@ -1 +1 @@ -{"manifest_version":2,"name":"Dissenter Extension","short_name":"Dissenter","description":"Dissenter is the comment section of the Internet.","homepage_url":"https://dissenter.com","icons":{"16":"assets/images/logo/icon-16.png","48":"assets/images/logo/icon-48.png","128":"assets/images/logo/icon-128.png"},"permissions":["activeTab","tabs","https://*.dissenter.com/*"],"browser_action":{"default_icon":"assets/images/logo/icon-128.png","default_popup":"popup/popup.html"},"commands":{"_execute_browser_action":{"suggested_key":{"default":"Alt+Shift+D","mac":"Alt+Shift+D"}}},"background":{"scripts":["background/background.js"],"persistent":false},"content_scripts":[{"matches":["https://*.twitter.com/*"],"js":["content/twitter/script/script.js"]},{"matches":["https://*.youtube.com/*"],"js":["content/youtube/script/script.js"]},{"matches":["https://*.reddit.com/*"],"js":["content/reddit/script/script.js"]},{"matches":["http://*/*","https://*/*"],"js":["content/all/script/script.js"]}],"content_security_policy":"script-src 'self' 'unsafe-eval'; object-src 'self' https://*.dissenter.com/*","incognito":"spanning","version":"0.1.3","author":"Gab.com"} \ No newline at end of file +{"manifest_version":2,"name":"Dissenter Extension","short_name":"Dissenter","description":"Dissenter is the comment section of the Internet.","homepage_url":"https://dissenter.com","icons":{"16":"assets/images/logo/icon-16.png","48":"assets/images/logo/icon-48.png","128":"assets/images/logo/icon-128.png"},"permissions":["activeTab","tabs","https://*.dissenter.com/*"],"browser_action":{"default_icon":"assets/images/logo/icon-128.png","default_popup":"popup/popup.html"},"commands":{"_execute_browser_action":{"suggested_key":{"default":"Alt+Shift+D","mac":"Alt+Shift+D"}}},"background":{"scripts":["background/background.js"],"persistent":false},"content_scripts":[{"matches":["https://*.twitter.com/*"],"js":["content/twitter/script/script.js"]},{"matches":["https://*.youtube.com/*"],"js":["content/youtube/script/script.js"]},{"matches":["https://*.reddit.com/*"],"js":["content/reddit/script/script.js"]}],"content_security_policy":"script-src 'self' 'unsafe-eval'; object-src 'self' https://*.dissenter.com/*","incognito":"spanning","version":"0.1.3","author":"Gab.com"} \ No newline at end of file diff --git a/build/firefox/content/all/script/script.js b/build/firefox/content/all/script/script.js deleted file mode 100644 index 276d599..0000000 --- a/build/firefox/content/all/script/script.js +++ /dev/null @@ -1,4 +0,0 @@ -/* Automatically generated file. Do not edit directly. -Copyright (C) 2019 Gab AI, Inc. -All Rights Reserved */ -var BROWSER_CONFIG={name:"Mozilla Firefox",slug:"firefox",version:"0.1.2"},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(t){return!isArray(t)&&!isDate(t)&&(null!==t&&"object"==typeof t)},isString=function(t){return"string"==typeof t||t instanceof String},isDate=function(t){return!isString(t)&&!isArray(t)&&null!=t&&null!=t&&(t&&"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(t))},isArray=function(t){return Array.isArray(t)};function ready(t){var e=document;"loading"==e.readyState?e.addEventListener("DOMContentLoaded",t):t()}function getQueryStringValue(t){return decodeURIComponent(window.location.search.replace(new RegExp("^(?:.*[&\\?]"+encodeURIComponent(t).replace(/[\.\+\*]/g,"\\$&")+"(?:\\=([^&]*))?)?.*$","i"),"$1"))}var GDAll=function(){var t=function(){function t(){var t=document.getElementById("disqus_thread");if(!t)return!1;var e=function(){var t=document.createElement("div");t.style.setProperty("display","block","important"),t.style.setProperty("width","100%","important"),t.style.setProperty("height","80px","important"),t.style.setProperty("padding","20px 0","important"),t.style.setProperty("overflow","hidden","important"),t.style.setProperty("box-sizing","border-box","important");var e=document.createElement("a");return e.textContent="View Comments on Dissenter",e.style.setProperty("display","block","important"),e.style.setProperty("width","100%","important"),e.style.setProperty("height","40px","important"),e.style.setProperty("background-color",COLOR_GAB_GREEN,"important"),e.style.setProperty("color","#fff","important"),e.style.setProperty("border-radius","4px","important"),e.style.setProperty("text-align","center","important"),e.style.setProperty("margin","0 auto","important"),e.style.setProperty("line-height","40px","important"),e.style.setProperty("font-size","14px","important"),e.style.setProperty("box-sizing","border-box","important"),e.style.setProperty("cursor","pointer","important"),t.appendChild(e),t}();return t.parentElement.insertBefore(e,t),e.onclick=r,!0}function r(){var t=window.location.href,e=window.innerHeight;browser.runtime.sendMessage({action:BACKGROUND_ACTION_OPEN_POPUP,url:t,height:e})}this.init=function(){t()}};this.init=function(){(new t).init()}};ready(function(){setTimeout(function(){(new GDAll).init()},5e3)}); \ No newline at end of file diff --git a/build/firefox/manifest.json b/build/firefox/manifest.json index 17cd6eb..b800190 100644 --- a/build/firefox/manifest.json +++ b/build/firefox/manifest.json @@ -1 +1 @@ -{"manifest_version":2,"name":"Dissenter Extension","short_name":"Dissenter","description":"Dissenter is the comment section of the Internet.","homepage_url":"https://dissenter.com","icons":{"16":"assets/images/logo/icon-16.png","48":"assets/images/logo/icon-48.png","128":"assets/images/logo/icon-128.png"},"permissions":["activeTab","tabs","https://*.dissenter.com/*"],"browser_action":{"default_icon":"assets/images/logo/icon-128.png","default_popup":"popup/popup.html"},"commands":{"_execute_browser_action":{"suggested_key":{"default":"Alt+Shift+D","mac":"Alt+Shift+D"}}},"background":{"scripts":["background/background.js"]},"content_scripts":[{"matches":["https://*.twitter.com/*"],"js":["content/twitter/script/script.js"]},{"matches":["https://*.youtube.com/*"],"js":["content/youtube/script/script.js"]},{"matches":["https://*.reddit.com/*"],"js":["content/reddit/script/script.js"]},{"matches":["http://*/*","https://*/*"],"js":["content/all/script/script.js"]}],"content_security_policy":"script-src 'self' 'unsafe-eval'; object-src 'self' https://*.dissenter.com/*","incognito":"spanning","version":"0.1.2","sidebar_action":{"default_title":"Dissenter","default_panel":"sidebar/sidebar.html","default_icon":"assets/images/logo/icon-128.png"}} \ No newline at end of file +{"manifest_version":2,"name":"Dissenter Extension","short_name":"Dissenter","description":"Dissenter is the comment section of the Internet.","homepage_url":"https://dissenter.com","icons":{"16":"assets/images/logo/icon-16.png","48":"assets/images/logo/icon-48.png","128":"assets/images/logo/icon-128.png"},"permissions":["activeTab","tabs","https://*.dissenter.com/*"],"browser_action":{"default_icon":"assets/images/logo/icon-128.png","default_popup":"popup/popup.html"},"commands":{"_execute_browser_action":{"suggested_key":{"default":"Alt+Shift+D","mac":"Alt+Shift+D"}}},"background":{"scripts":["background/background.js"]},"content_scripts":[{"matches":["https://*.twitter.com/*"],"js":["content/twitter/script/script.js"]},{"matches":["https://*.youtube.com/*"],"js":["content/youtube/script/script.js"]},{"matches":["https://*.reddit.com/*"],"js":["content/reddit/script/script.js"]}],"content_security_policy":"script-src 'self' 'unsafe-eval'; object-src 'self' https://*.dissenter.com/*","incognito":"spanning","version":"0.1.2","sidebar_action":{"default_title":"Dissenter","default_panel":"sidebar/sidebar.html","default_icon":"assets/images/logo/icon-128.png"}} \ No newline at end of file diff --git a/config/manifest.js b/config/manifest.js index e65c73c..83846be 100644 --- a/config/manifest.js +++ b/config/manifest.js @@ -43,13 +43,6 @@ module.exports = manifest = { { "matches": ["https://*.reddit.com/*"], "js": ["content/reddit/script/script.js"] - }, - { - "matches": [ - "http://*/*", - "https://*/*" - ], - "js": ["content/all/script/script.js"] } ], "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self' https://*.dissenter.com/*", diff --git a/gulpfile.js b/gulpfile.js index ffe1f20..de77513 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -155,7 +155,6 @@ gulp.task('scripts', () => { if (browser.slug !== 'safari') promises.push(getPromise('script', 'src/scripts/content/twitter/**', browser, 'content/twitter')); if (browser.slug !== 'safari') promises.push(getPromise('script', 'src/scripts/content/youtube/**', browser, 'content/youtube')); if (browser.slug !== 'safari') promises.push(getPromise('script', 'src/scripts/content/reddit/**', browser, 'content/reddit')); - if (browser.slug !== 'safari') promises.push(getPromise('script', 'src/scripts/content/all/**', browser, 'content/all')); if (browser.slug !== 'safari') promises.push(getPromise('background', 'src/scripts/background/**', browser)); if (browser.slug === 'firefox') promises.push(getPromise('sidebar', 'src/scripts/components/sidebar.js', browser)); }; diff --git a/src/scripts/content/all/script.js b/src/scripts/content/all/script.js deleted file mode 100644 index 9150a0f..0000000 --- a/src/scripts/content/all/script.js +++ /dev/null @@ -1,127 +0,0 @@ -/** - * @description - Gab Dissenter - All websites content script - */ -var GDAll = function() { - //Global scope - var scope = this; - - var GDDisqus = function() { - - //Global scope - var scope = this; - - /** - * @description - Attempts to find disqus thread on any site and appends dissenter button before it - * @function fetchElements - * @return {Boolean} success - */ - function fetchElements() { - //Find disqus section - var disqusSection = document.getElementById('disqus_thread'); - - //Make sure it exists, if no, return - if (!disqusSection) return false; - - //Create new btn, append and add action - var dissentBtn = createDissentBtn(); - - //Get parent of disqus thread - var parentElement = disqusSection.parentElement; - //Insert button before the thread within the thread's parent - parentElement.insertBefore(dissentBtn, disqusSection); - - //Set onclick event - dissentBtn.onclick = dissentThisPage; - - //Success - return true; - }; - - /** - * @description - Helper to create "View Comments on Dissenter" button with styles - * @function createDissentBtn - * @return {Node} - */ - function createDissentBtn() { - //Create container - var container = document.createElement("div"); - container.style.setProperty("display", 'block', "important"); - container.style.setProperty("width", '100%', "important"); - container.style.setProperty("height", '80px', "important"); - container.style.setProperty("padding", '20px 0', "important"); - container.style.setProperty("overflow", 'hidden', "important"); - container.style.setProperty("box-sizing", 'border-box', "important"); - - //Create button with same general style as "Subscribe" button but with new Gab Dissenter styles - var button = document.createElement("a"); - button.textContent = "View Comments on Dissenter"; - button.style.setProperty("display", 'block', "important"); - button.style.setProperty("width", '100%', "important"); - button.style.setProperty("height", '40px', "important"); - button.style.setProperty("background-color", COLOR_GAB_GREEN, "important"); - button.style.setProperty("color", '#fff', "important"); - button.style.setProperty("border-radius", '4px', "important"); - button.style.setProperty("text-align", 'center', "important"); - button.style.setProperty("margin", '0 auto', "important"); - button.style.setProperty("line-height", '40px', "important"); - button.style.setProperty("font-size", '14px', "important"); - button.style.setProperty("box-sizing", 'border-box', "important"); - button.style.setProperty("cursor", 'pointer', "important"); - - //Append - container.appendChild(button); - - //Return container - return container; - }; - - /** - * @description - Makes a request to the background to open a new dissenter comment window with current page url - * @function dissentThisPage - */ - function dissentThisPage() { - //Get url, height - var url = window.location.href; - var height = window.innerHeight; - - //Send message to background to open popup window - __BROWSER__.runtime.sendMessage({ - action: BACKGROUND_ACTION_OPEN_POPUP, - url: url, - height: height - }); - }; - - /** - * @description - Init script on open - * @function scope.init - */ - scope.init = function() { - fetchElements(); - }; - }; - - - //Global functions - - - /** - * @description - Init script on open - * @function scope.init - */ - scope.init = function() { - //Init Disqus - var gdd = new GDDisqus(); - gdd.init(); - }; -}; - -//Wait for page to be ready and loaded -ready(function() { - //Delay a bit - setTimeout(function () { - //Init new script - var gda = new GDAll(); - gda.init(); - }, 5000); -});