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

Always

Just for now

Changes in response to PR requested changes.

  • Loading branch information
Serge Zarembsky
Serge Zarembsky committed Mar 30, 2018
commit 355487edd39b29d26595be94219d1f0e3c874744
@@ -162,20 +162,17 @@ const Click2PlayContentScript = (function (win, doc) {
}

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

if (!reqMsg) {
return false;
}

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];
const reqMsg = request.message;
if (reqMsg) {
// 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 (doc.readyState === 'complete') {
applyC2P(reqMsg.app_id, reqMsg.data, reqMsg.html);
if (doc.readyState === 'complete') {
applyC2P(reqMsg.app_id, reqMsg.data, reqMsg.html);
}
}
}

@@ -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'));

@@ -348,7 +348,7 @@ class PanelData {
.set('pageHost', pageHost)
.set('performanceData', tab && tabInfo.getTabInfo(tab_id, 'pageTiming'))
.set('sitePolicy', tab && policy.getSitePolicy(tab_url) || false)
.set('siteNotScanned', tab && !trackerList.length || false)
.set('siteNotScanned', tab && !foundBugs.getApps(tab_id) || false)
.set('tab_id', tab_id)

This comment has been minimized.

@jsignanini

jsignanini Mar 30, 2018
Member

@zarembsky foundBugs.getApps() returns 3 states, false for page not scanned, [] for page scanned but found no trackers, and [tracker, tracker, ...] for page scanned and trackers were found. So we should leave this as it was.

.set('trackerCounts', tab && foundBugs.getAppsCountByBlocked(tab_id) || {})
.set('smartBlock', tabInfo.getTabInfo(tab_id, 'smartBlock'));
ProTip! Use n and p to navigate between commits in a pull request.