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 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

use data:image on blocked_redirect

  • Loading branch information
christophertino committed May 7, 2019
commit 3c80a39f3b9c1e3acbf7d5f53405ba5434d74518
@@ -25,6 +25,7 @@
* @namespace BlockedRedirectContentScript
*/
import msgModule from './utils/msg';
import { ghosty_blocked, allow_once, allow_unblock } 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 = ghosty_blocked;
document.getElementById('allow_once').src = allow_once;
document.getElementById('allow_unblock').src = 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
@@ -12,7 +12,7 @@ import ghostery_vkontakte from './ghostery_vkontakte';
import ghosty_blocked from './ghosty_blocked';
import ghosty_blocked_big from './ghosty_blocked_big';

export default {
export {
allow_once,
allow_unblock,
ghostery_facebook,
@@ -26,4 +26,4 @@ export default {
ghostery_vkontakte,
ghosty_blocked,
ghosty_blocked_big,
}
}
@@ -50,9 +50,9 @@
<div id="redirect-prevent"></div>
<br>
<div id="redirect-url" style="display: none;"></div>
<img src="../images/click2play/ghostery_blocked.png">
<a href="#" id="action-through-once"><img src="../images/click2play/allow_once.png" /></a>
<a href="#" id="action-always"><img src="../images/click2play/allow_always.png" /></a>
<img id="ghosty_blocked" src="../images/click2play/ghostery_blocked.png">
<a href="#" id="action-through-once"><img id="allow_once" src="../images/click2play/allow_once.png" /></a>
<a href="#" id="action-always"><img id="allow_unblock" src="../images/click2play/allow_always.png" /></a>
</div>
</body>
</html>
ProTip! Use n and p to navigate between commits in a pull request.