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 for GH-872, "Not Scanned" case. #15

Merged
merged 5 commits into from Apr 3, 2018
Merged
Changes from all commits
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -161,17 +161,17 @@ const Click2PlayContentScript = (function (win, doc) {
return false;
}

const { name } = request;
const reqMsg = request.msg;

const { name, message } = request;
log('click_to_play.js received message', name);

if (name === 'c2p') {
// queue Click-to-Play data so that we process multiple Twitter buttons at once, for example
C2P_DATA[reqMsg.app_id] = [reqMsg.app_id, reqMsg.data, reqMsg.html];
if (message) {
// queue Click-to-Play data so that we process multiple Twitter buttons at once, for example
C2P_DATA[message.app_id] = [message.app_id, message.data, message.html];

if (doc.readyState === 'complete') {
applyC2P(reqMsg.app_id, reqMsg.data, reqMsg.html);
if (doc.readyState === 'complete') {
applyC2P(message.app_id, message.data, message.html);
}
}
}

@@ -731,8 +731,7 @@ const NotificationsContentScript = (function (win, doc) {
'showCMPMessage',
'showBrowseWindow'
];
const { name } = request;
const reqMsg = request.message;
const { name, message } = request;

log('notifications.js received message', name);

@@ -744,29 +743,29 @@ const NotificationsContentScript = (function (win, doc) {
}

if (name === 'showCMPMessage') {
CMP_DATA = reqMsg.data;
CMP_DATA = message.data;
showAlert('showCMPMessage', {
campaign: CMP_DATA
});
ALERT_SHOWN = true;
} else if (name === 'showUpgradeAlert') {
NOTIFICATION_TRANSLATIONS = reqMsg.translations;
LANGUAGE = reqMsg.language || 'en';
showAlert('showUpgradeAlert', reqMsg.major_upgrade);
NOTIFICATION_TRANSLATIONS = message.translations;
LANGUAGE = message.language || 'en';
showAlert('showUpgradeAlert', message.major_upgrade);
ALERT_SHOWN = true;
} else if (name === 'showLibraryUpdateAlert') {
NOTIFICATION_TRANSLATIONS = reqMsg.translations;
LANGUAGE = reqMsg.language || 'en';
NOTIFICATION_TRANSLATIONS = message.translations;
LANGUAGE = message.language || 'en';
showAlert('showLibraryUpdateAlert');
ALERT_SHOWN = true;
// Import/Export related messages
} else if (name === 'showBrowseWindow') {
showBrowseWindow(reqMsg.translations);
showBrowseWindow(message.translations);
ALERT_SHOWN = true;
} else if (name === 'onFileImported') {
updateBrowseWindow(reqMsg);
updateBrowseWindow(message);
} else if (name === 'exportFile') {
exportFile(reqMsg);
exportFile(message);
}

// trigger a response callback to src/background so that we can handler errors properly
@@ -303,7 +303,7 @@ class Summary extends React.Component {
render() {
const showBody = (!this.props.is_expanded || !this.props.is_expert);
const buttonDisabled = (this.state.disableBlocking || this.props.paused_blocking || this.props.sitePolicy !== false);
const alertText = this.props.paused_blocking ? t('enable_when_paused') : (this.props.sitePolicy === 1) ? t('enable_when_blacklisted') : (this.props.sitePolicy === 2) ? t('enable_when_whitelisted') : this.props.siteNotScanned ? t('enable_when_not_scanned') : '';
const alertText = this.props.paused_blocking ? t('enable_when_paused') : (this.props.sitePolicy === 1) ? t('enable_when_blacklisted') : (this.props.sitePolicy === 2) ? t('enable_when_whitelisted') : this.state.disableBlocking ? t('enable_when_not_scanned') : '';
const getTooltipClass = () => ((!this.props.is_expert && 'top')
|| ((this.props.is_expert && this.props.is_expanded) && 'right'));

ProTip! Use n and p to navigate between commits in a pull request.