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

Side by Side Diff: chrome/test/data/extensions/api_test/cross_origin_xhr/content_script/content_script.js

Issue 7071025: Use WebFrame::setIsolatedWorldSecurityOrigin to allow cross-origin XHRs in content scripts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove isolated worlds when extension is unloaded Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 chrome.extension.onRequest.addListener(
6 function(url, sender, sendResponse) {
7 var req = new XMLHttpRequest();
8 console.log('Requesting url: ' + url);
9 req.open('GET', url, true);
10
11 req.onload = function() {
12 sendResponse({
13 'event': 'load',
14 'status': req.status,
15 'text': req.responseText
16 });
17 };
18 req.onerror = function() {
19 sendResponse({
20 'event': 'error',
21 'status': req.status,
22 'text': req.responseText
23 });
24 };
25
26 req.send(null);
27 });
28
29 chrome.extension.sendRequest('injected');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698