Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix blocked_redirect by fixing promises and images #380

Merged
merged 5 commits into from May 8, 2019
Merged
Changes from all commits
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -1,3 +1,7 @@
### GHOSTERY 8.3.4 (May 8, 2019)

+ Fixes bug in Click2Play redirect blocking

### GHOSTERY 8.3.3 (April 24, 2019)

+ Fixes bug where Ad-Blocker/Anti-Tracking modules did not respect whitelist settings
@@ -25,6 +25,7 @@
* @namespace BlockedRedirectContentScript
*/
import msgModule from './utils/msg';
import c2p_images from '../data-images/click2play';

const msg = msgModule('blocked_redirect');
const { sendMessage, sendMessageInPromise } = msg;
@@ -88,6 +89,11 @@ const { sendMessage, sendMessageInPromise } = msg;
APP_ID = blockedRedirectData.app_id;
const { translations, blacklisted } = blockedRedirectData;
document.title = translations.blocked_redirect_page_title;
// Set data images
document.getElementById('ghosty_blocked').src = c2p_images.ghosty_blocked;
document.getElementById('allow_once').src = c2p_images.allow_once;
document.getElementById('allow_unblock').src = c2p_images.allow_unblock;
// Set translated titles
document.getElementById('redirect-prevent').innerHTML = translations.blocked_redirect_prevent;
document.getElementById('action-always').firstChild.title = translations.blocked_redirect_action_always_title; // firstChild should be the action_always image
document.getElementById('action-through-once').firstChild.title = translations.blocked_redirect_action_through_once_title; // firstChild should be the action_always image
@@ -33,7 +33,7 @@ export default function (origin) {
* @return {Promise} response or null
*/
function sendMessageInPromise(name, message) {
panelSendPromiseMessage(name, message, origin);
return panelSendPromiseMessage(name, message, origin);
}

/**
@@ -26,4 +26,4 @@ export default {
ghostery_vkontakte,
ghosty_blocked,
ghosty_blocked_big,
}
}
@@ -81,7 +81,7 @@ export function sendMessageInPromise(name, message, origin = '') {
});
});
}
return new Promise(((resolve) => {
return new Promise((resolve) => {
chrome.runtime.sendMessage({
name,
message,
@@ -93,7 +93,7 @@ export function sendMessageInPromise(name, message, origin = '') {
}
resolve(response);
});
}));
});
}

/**
@@ -50,9 +50,9 @@
<div id="redirect-prevent"></div>
<br>
<div id="redirect-url" style="display: none;"></div>
<img src="../images/click2play/ghosty_blocked.data">
<a href="#" id="action-through-once"><img src="../images/click2play/allow_through.data" /></a>
<a href="#" id="action-always"><img src="../images/click2play/allow_unblock.data" /></a>
<img id="ghosty_blocked" src="">
<a href="#" id="action-through-once"><img id="allow_once" src="" /></a>
<a href="#" id="action-always"><img id="allow_unblock" src="" /></a>
</div>
</body>
</html>
@@ -9,8 +9,8 @@
"author": "Ghostery",
"name": "__MSG_name__",
"short_name": "Ghostery",
"version": "8.3.3",
"version_name": "8.3.3",
"version": "8.3.4",
"version_name": "8.3.4",
"default_locale": "en",
"description": "__MSG_short_description__",
"icons": {
@@ -100,4 +100,4 @@
"app/images/*",
"dist/css/rewards_styles.css"
]
}
}
ProTip! Use n and p to navigate between commits in a pull request.