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

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: Address last feedback 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..f547f3c77eec6d7b2bf4c553441f4ce020556c34 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,28 @@ cvox.ChromeVox.initDocument = function() {
return;
}
+ // Look for ChromeVox-specific meta attributes.
+ var disableContentScript = false;
+ if (document.head) {
+ document.head.querySelectorAll('meta[name="chromevox"]').forEach(
+ function(meta) {
+ var contentScript = meta.getAttribute('content-script');
+ if (contentScript && contentScript.toLowerCase() == 'no') {
+ disableContentScript = true;
+ }
+ });
+ }
+ if (disableContentScript) {
+ 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