Chromium Code Reviews| 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', |