Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #32 from bcye/dev
Browse files Browse the repository at this point in the history
v1.3
  • Loading branch information
bcye authored Sep 1, 2019
2 parents 226b100 + fa6e066 commit 2caa387
Show file tree
Hide file tree
Showing 25 changed files with 323 additions and 106 deletions.
13 changes: 13 additions & 0 deletions .idea/Hello-Goodbye-Extension.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed Chrome/app.zip
Binary file not shown.
119 changes: 69 additions & 50 deletions Chrome/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,59 +9,78 @@ chrome.storage.onChanged.addListener(function(changes, namespace) {
isDisabled = storageChange;
console.log(isDisabled);
}
}
});
}
});

// block outgoing requests for help widgets
chrome.webRequest.onBeforeRequest.addListener(
function(details) {
// set badge text to indicate that a help widget is available
chrome.browserAction.setBadgeText({text: "HELP", tabId: details.tabId});
function(details) {
// set badge text to indicate that a help widget is available
chrome.browserAction.setBadgeText({text: "HELP", tabId: details.tabId});

if (isDisabled) {
return { cancel: false } // this should return from the function (details) level
} else {
return { cancel: true }
}
},
{urls: [
"*://widget.intercom.io/*",
"*://connect.facebook.net/en_US/sdk/xfbml.customerchat.js",
"*://assets.producthunt.com/assets/upwigloader.js",
"*://js.driftt.com/include/*",
"*://*.crisp.chat/*",
"*://*.intergram.xyz/js/*",
"*://widget.mfy.im/*",
"*://connect.podium.com/*",
"*://js.usemessages.com/*",
"*://static.getchipbot.com/",
"*://static.zdassets.com/ekr/snippet.js",
"*://www.couchbase.com/webfiles/1552355627964/js/contact-popup-form.js",
"*://assetscdn-wchat.freshchat.com/*",
"*://wchat.freshchat.com/*",
"*://code.jivosite.com/script/widget/*",
"*://code.tidio.co/*",
"*://*.user.com/static/js/*",
"*://secure.livechatinc.com/*",
"*://*.justanswer.com/revizely/2/core/ja-com.js",
"*://code.snapengage.com/*",
"*://sdk.inbenta.io/chatbot/*",
"*://pi2.movoto.com/1.7.654/javascripts/desktop/movoto.min.js",
"*://*.zopim.com/*",
"*://cdn.gubagoo.io/*",
"*://leadconnect.ipmaxi.se/*",
"*://static.small.chat/messenger.js",
"*://smartsupp-widget-161959.c.cdn77.org/build/smartchat-2.3.20.min.js",
"*://plugins.help.com/*",
"*://js.gs-chat.com/*",
"*://widget.customerly.io/*",

if (isDisabled) {
return { cancel: false } // this should return from the function (details) level
} else {
return { cancel: true }
}
},
{urls: [
"*://widget.intercom.io/*",
"*://connect.facebook.net/en_US/sdk/xfbml.customerchat.js",
"*://assets.producthunt.com/assets/upwigloader.js",
"*://js.driftt.com/include/*",
"*://*.crisp.chat/*",
"*://*.intergram.xyz/js/*",
"*://widget.mfy.im/*",
"*://connect.podium.com/*",
"*://js.usemessages.com/*",
"*://static.getchipbot.com/",
"*://static.zdassets.com/ekr/snippet.js",
"*://www.couchbase.com/webfiles/1552355627964/js/contact-popup-form.js",
"*://assetscdn-wchat.freshchat.com/*",
"*://wchat.freshchat.com/*",
"*://code.jivosite.com/script/widget/*",
"*://code.tidio.co/*",
"*://*.user.com/static/js/*",
"*://secure.livechatinc.com/*",
"*://*.justanswer.com/revizely/2/core/ja-com.js",
"*://code.snapengage.com/*",
"*://sdk.inbenta.io/chatbot/*",
"*://pi2.movoto.com/1.7.654/javascripts/desktop/movoto.min.js",
"*://*.zopim.com/*",
"*://cdn.gubagoo.io/*",
"*://leadconnect.ipmaxi.se/*",
"*://static.small.chat/messenger.js",
"*://smartsupp-widget-161959.c.cdn77.org/build/smartchat-2.3.20.min.js",
"*://plugins.help.com/*"
]},
["blocking"]);

chrome.runtime.onInstalled.addListener(function() {
// block consent banners
"*://consent-manager.metomic.io/embed.js",
"*://cdn.jsdelivr.net/npm/cookie-bar/*",
"*://*.PrivacyPolicies.com/cookie-consent/*",
"*://cdn.jsdelivr.net/npm/cookieconsent@3/*",
"*://cdn.ziffstatic.com/jst/*/zdconsent.js",
"*://guce.yahoo.com/*",
"*://*/js/xf/notice.min.js?*",
"*://*/wp/wp-content/themes/v3ct/lib/cookies.min.js",
"*://*/wp/wp-content/plugins/woocommerce/assets/js/js-cookie/js.cookie.min.js?*",
"*://consent.truste.com/*",
"*://*.quantserve.com/*",
"*://*.consensu.org/*",
"*://cdn.componentator.com/spa.min*"
]},
["blocking"]);

chrome.tabs.create({
url: 'https://hellogoodbye.app/postinstall.html',
active: true
});
chrome.runtime.onInstalled.addListener(function(details) {

if (details.reason === "install" || details.reason === "update") {
chrome.tabs.create({
url: 'https://hellogoodbye.app/postinstall.html',
active: true
});
}

return false;
});
return false;
});
9 changes: 4 additions & 5 deletions Chrome/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Hello, Goodbye! - Chat popup blocker",
"version": "1.2.1",
"description": "Block chat popups",
"name": "Hello, Goodbye",
"version": "1.3",
"description": "Hello, Goodbye blocks annoying chat widgets and cookie banners to make your internet a little bit better.",
"icons": {
"32": "icons/HGB@0,25x.png",
"64": "icons/HGB@0,5x.png",
Expand All @@ -11,8 +11,7 @@
"storage",
"webRequest",
"webRequestBlocking",
"*://*/*",
"activeTab"
"*://*/*"
],
"background": {
"scripts": ["background.js"],
Expand Down
44 changes: 0 additions & 44 deletions Chrome/options.js

This file was deleted.

13 changes: 8 additions & 5 deletions Chrome/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
<script type="text/javascript" src="popup.js"></script>
</head>
<body>
<h1>Hello, Goodbye</h1>
<h2>Block Chat Bubbles</h2>
<div id="app">
<button id="disable-btn" class="toggle-btn">Disable</button>
<button id="enable-btn" class="toggle-btn">Enable</button><br><br>

<button id="disable-btn" class="toggle-btn">Disable</button>
<button id="enable-btn" class="toggle-btn">Enable</button><br><br>
<a href="https://bruce160.typeform.com/to/zuyFeV">Is this site broken?</a> <br>
<a href="mailto:[email protected]">Need help with the extension?</a> <br>
<a href="https://github.com/bcye/Hello-Goodbye">Contribute to this extension</a>
</div>

<a href="https://bruce160.typeform.com/to/zuyFeV">Something is wrong? Report a link.</a> <br><br>
<br><br>
</body>
</html>
16 changes: 16 additions & 0 deletions Chrome/popup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// check if extension is enabled or disabled
chrome.storage.sync.get('disabled', function(value) {
if (value.disabled) {
hideButton('disable-btn');
Expand Down Expand Up @@ -40,3 +41,18 @@ chrome.storage.sync.get('disabled', function(value) {
}
document.getElementById('enable-btn').addEventListener('click', enableExtension);
});

chrome.storage.onChanged.addListener(function(changes, namespace) {
for (var key in changes) {
var storageChange = changes[key].newValue;
if (key === 'verified') {
if (storageChange) {
document.getElementById('app').style.display = 'inline-block';
document.getElementById('payment-form').style.display = 'none';
} else {
document.getElementById('app').style.display = 'none';
document.getElementById('payment-form').style.display = 'inline-block';
}
}
}
});
Loading

0 comments on commit 2caa387

Please sign in to comment.