Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3887)

Unified Diff: chrome/browser/resources/chromeos/chromevox/chromevox/injected/init_document.js

Issue 2074513002: Parse meta tag that disables ChromeVox content script and forces compat mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/chromevox/chromevox/injected/init_document.js
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/init_document.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/init_document.js
index e22cfc8adbbfbb57311f9dab2b08b38c3057ada3..23b4b074033736d18dd6610b01eaf6708148b0d6 100644
--- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/init_document.js
+++ b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/init_document.js
@@ -83,6 +83,26 @@ cvox.ChromeVox.initDocument = function() {
return;
}
+ // Look for ChromeVox-specific meta attributes.
+ var disableContentScript = false;
+ document.querySelectorAll('head meta[name="chromevox"]').forEach(
David Tseng 2016/06/15 22:50:16 Could you do: document.head.querySelectorAll(...
dmazzoni 2016/06/16 20:00:06 Done.
+ function(meta) {
+ if (meta.getAttribute('content-script').toLowerCase() == 'no') {
David Tseng 2016/06/15 22:50:16 Check getAttribute('content-script') is non-null.
dmazzoni 2016/06/16 20:00:06 Done.
+ disableContentScript = true;
+ }
+ });
+ if (disableContentScript) {
+ window.console.log('Disabling ChromeVox content script due to meta tag.');
+ var url = location.href;
+ url = url.substring(0, url.indexOf('#')) || url;
+ cvox.ExtensionBridge.send({
+ target: 'next',
+ action: 'enableCompatForUrl',
+ url: url
+ });
+ return;
+ }
+
cvox.ExtensionBridge.send({
target: 'next',
action: 'getIsClassicEnabled',

Powered by Google App Engine
This is Rietveld 408576698