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

Unified Diff: chrome/test/data/extensions/api_test/active_tab/iframe.js

Issue 890083002: [Extensions] Propagate activeTab hosts to extension background pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/test/data/extensions/api_test/active_tab/iframe.js
diff --git a/chrome/test/data/extensions/api_test/active_tab/iframe.js b/chrome/test/data/extensions/api_test/active_tab/iframe.js
new file mode 100644
index 0000000000000000000000000000000000000000..da70af91735f705472d3696944ce9c79e19ba48c
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/active_tab/iframe.js
@@ -0,0 +1,19 @@
+function canXhr(url) {
not at google - send to devlin 2015/02/05 22:40:23 you might get a copyright header presubmit fail if
Devlin 2015/02/06 18:59:53 Done.
+ var xhr = new XMLHttpRequest();
+ xhr.open('GET', url, false);
+ var success = true;
+ try {
+ xhr.send();
+ } catch(e) {
+ success = false;
+ console.error(e);
not at google - send to devlin 2015/02/05 22:40:23 Do you really want to be logging this? (also same
Devlin 2015/02/06 18:59:53 Nope!
+ }
+ return success;
+}
+
+document.addEventListener('DOMContentLoaded', function() {
+ chrome.runtime.sendMessage({message:'xhr'}, function(response) {
+ var success = canXhr(response.url);
+ chrome.runtime.sendMessage({success:success});
+ });
+});

Powered by Google App Engine
This is Rietveld 408576698