Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions readiness-tool/content_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,19 @@ function findDetectedVendors(html, tabId) {
totalTags =
detectedVendors.supported.ads.length +
detectedVendors.supported.analytics.length +
detectedVendors.supported.cms.length +
detectedVendors.notSupported.ads.length +
detectedVendors.notSupported.analytics.length;
detectedVendors.notSupported.analytics.length +
detectedVendors.notSupported.cms.length;

notSupported =
detectedVendors.notSupported.ads.length +
detectedVendors.notSupported.analytics.length;
detectedVendors.notSupported.analytics.length +
detectedVendors.notSupported.cms.length;
supported =
detectedVendors.supported.ads.length +
detectedVendors.supported.analytics.length;
detectedVendors.supported.analytics.length +
detectedVendors.supported.cms.length;

if (notSupported == 0 && supported > 0) {
color = [122, 186, 122, 255];
Expand Down Expand Up @@ -86,10 +90,12 @@ function filteredVendors(htmlString, listAllVendors) {
supported: {
ads: [],
analytics: [],
cms: [],
},
notSupported: {
ads: [],
analytics: [],
cms: [],
},
};
// for all the vendor objects in the vendors.json file
Expand All @@ -107,7 +113,8 @@ function filteredVendors(htmlString, listAllVendors) {
return;
} else if (
vendorConfig.category != 'Ads' &&
vendorConfig.category != 'Analytics'
vendorConfig.category != 'Analytics' &&
vendorConfig.category != 'CMS'
) {
console.error(
'The vendor',
Expand Down Expand Up @@ -165,6 +172,12 @@ function addToDict(
filteredVendors.notSupported.ads.push(vendorName);
}
break;
case 'CMS':
if (isSupported(vendorName)) {
filteredVendors.supported.cms.push(vendorName);
} else {
filteredVendors.notSupported.cms.push(vendorName);
}
}
}
}
Expand All @@ -184,12 +197,18 @@ function isVendorNameUnique(obj, vendorName) {
if (obj.supported.analytics.includes(vendorName)) {
count++;
}
if (obj.supported.cms.includes(vendorName)) {
count++;
}
if (obj.notSupported.ads.includes(vendorName)) {
count++;
}
if (obj.notSupported.analytics.includes(vendorName)) {
count++;
}
if (obj.notSupported.cms.includes(vendorName)) {
count++;
}
return count < 1;
}

Expand Down
Binary file added readiness-tool/icons/Bing Ads.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readiness-tool/icons/BlueKai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added readiness-tool/icons/Branch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions readiness-tool/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "AMP Readiness Tool",
"description": "See at a glance the various third party vendors on the page and whether they have AMP support.",
"version": "2.8",
"version": "2.12",
"options_page": "options.html",
"icons": {
"16": "amp-readiness.png",
Expand All @@ -29,7 +29,8 @@
"all_frames": false,
"run_at": "document_end",
"exclude_globs": [
"*.corp.google.com/*"
"*.corp.google.com/*",
"*.google.com/*"
]
}
],
Expand Down
8 changes: 4 additions & 4 deletions readiness-tool/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -827,12 +827,12 @@
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communiampion sent
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communiampion on electronic mailing lists, source code control systems,
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communiampion that is conspicuously marked or otherwise
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
Expand Down Expand Up @@ -981,4 +981,4 @@
</div>
</body>

</html>
</html>
21 changes: 18 additions & 3 deletions readiness-tool/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@
margin-top: 35px;
}

.cms-row {
margin-top: 35px;
}

.collapsible {
color: #1c79c0;
text-transform: uppercase;
Expand Down Expand Up @@ -291,6 +295,7 @@ <h3 class="supported title">
</h3>

<div class="rows">

<div class="ads-row">
<label class="collapsible" for="expanding-1">Ads </label>
<div id="ads-supported" class="expanding-list"></div>
Expand All @@ -300,8 +305,13 @@ <h3 class="supported title">
<label class="collapsible" for="expanding-2">Analytics </label>
<div id="analytics-supported" class="expanding-list"></div>
</div>
</div>

<div class="cms-row">
<label class="collapsible" for="expanding-3">CMS </label>
<div id="cms-supported" class="expanding-list"></div>
</div>

</div>
</div>
</div>

Expand All @@ -314,14 +324,19 @@ <h3 class="not-supported title">

<div class="rows">
<div class="ads-row">
<label class="collapsible" for="expanding-3">Ads </label>
<label class="collapsible" for="expanding-4">Ads </label>
<div id="ads-notSupported" class="expanding-list"></div>
</div>

<div class="analytics-row">
<label class="collapsible" for="expanding-4">Analytics </label>
<label class="collapsible" for="expanding-5">Analytics </label>
<div id="analytics-notSupported" class="expanding-list"></div>
</div>

<div class="cms-row">
<label class="collapsible" for="expanding-6">CMS </label>
<div id="cms-notSupported" class="expanding-list"></div>
</div>
</div>

</div>
Expand Down
31 changes: 26 additions & 5 deletions readiness-tool/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ let supportedAds;
/* @const {!Element} */
let supportedAnalytics;

/* @const {!Element} */
let supportedCMS;

/* @const {!Element} */
let notSupportedAds;

/* @const {!Element} */
let notSupportedAnalytics;

/* @const {!Element} */
let notSupportedCMS;

/* @const {string} */
const loadingMessage = "Loading...";

Expand All @@ -30,19 +36,25 @@ chrome.storage.onChanged.addListener(function(changes, namespace) {
function showLoading() {
supportedAds = document.getElementById('ads-supported');
supportedAnalytics = document.getElementById('analytics-supported');
supportedCMS = document.getElementById('cms-supported');
notSupportedAds = document.getElementById('ads-notSupported');
notSupportedAnalytics = document.getElementById('analytics-notSupported');
notSupportedCMS = document.getElementById('cms-notSupported');

supportedAds.textContent = supportedAnalytics.textContent =
notSupportedAds.textContent = notSupportedAnalytics.textContent =

supportedAds.textContent = supportedAnalytics.textContent =
supportedCMS.textContent = notSupportedAds.textContent =
notSupportedAnalytics.textContent = notSupportedCMS.textContent =
loadingMessage;
}

window.onload = function onWindowLoad() {
supportedAds = document.getElementById('ads-supported');
supportedAnalytics = document.getElementById('analytics-supported');
supportedCMS = document.getElementById('cms-supported');
notSupportedAds = document.getElementById('ads-notSupported');
notSupportedAnalytics = document.getElementById('analytics-notSupported');
notSupportedCMS = document.getElementById('cms-notSupported');
};

/**
Expand Down Expand Up @@ -103,27 +115,36 @@ function showSupportedVendorsInView(detectedVendors, listAllVendors) {
return;
}

supportedAds.textContent = supportedAnalytics.textContent =
notSupportedAds.textContent = notSupportedAnalytics.textContent =
supportedAds.textContent = supportedAnalytics.textContent =
supportedCMS.textContent = notSupportedAds.textContent =
notSupportedAnalytics.textContent = notSupportedCMS.textContent =
blankMessage;
supportedAds.appendChild(
makeList(detectedVendors.supported.ads, false, listAllVendors)
);
supportedAnalytics.appendChild(
makeList(detectedVendors.supported.analytics, false, listAllVendors)
);
supportedCMS.appendChild(
makeList(detectedVendors.supported.cms, false, listAllVendors)
);
notSupportedAds.appendChild(
makeList(detectedVendors.notSupported.ads, true, listAllVendors)
);
notSupportedAnalytics.appendChild(
makeList(detectedVendors.notSupported.analytics, true, listAllVendors)
);
notSupportedCMS.appendChild(
makeList(detectedVendors.notSupported.cms, true, listAllVendors)
);

totalTags =
detectedVendors.supported.ads.length +
detectedVendors.supported.analytics.length +
detectedVendors.supported.cms.length +
detectedVendors.notSupported.ads.length +
detectedVendors.notSupported.analytics.length;
detectedVendors.notSupported.analytics.length +
detectedVendors.notSupported.cms.length;
}

/**
Expand Down
30 changes: 28 additions & 2 deletions readiness-tool/vendors.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
"regex": [
"googletagmanager\\.com/ns\\.html[^>]+></iframe",
"google_tag_manager\\[",
"^googletag$"
"googletag"
]
},
"Heap": {
Expand Down Expand Up @@ -587,6 +587,32 @@
"regex": [
"<script[\\s\\S]*googleads\\.g\\.doubleclick\\.net/pagead/viewthroughconversion[\\s\\S]*script>"
]
},
"Bing Ads": {
"category": "Ads",
"regex": [
"<script[\\s\\S]*bat\\.bing\\.com/bat.js[\\s\\S]*script>"
]
},
"BlueKai": {
"category": "Ads",
"regex":[
"__bkframe"
]
},
"Adobe Experience Manager": {
"category": "CMS",
"regex":[
"<div class=\"[^\"]*parbase",
"<div[^>]+data-component-path=\"[^\"+]jcr:"
]
},
"Wordpress": {
"category": "CMS",
"regex":[
"<link rel=[\"']stylesheet[\"'] [^>]+wp-(?:content|includes)",
"<link[^>]+s\\d+\\.wp\\.com"
]
}
}
}
}