redirectUrl in Chrome apps?

With Chrome extensions can be done, but it will be possible with Chrome apps?

chrome.webRequest.onBeforeRequest.addListener(function (info) {
    return {redirectUrl: "http://www.newurl.com/file.js"};
}, {
    urls: ["*://www.originalurl.com/file.js"]
},
["blocking"]);

Upvotes: 2

Views: 129

Answers (1)

Xan
Xan

Reputation: 77482

No, it is not possible.

The list of supported APIs in apps: https://developer.chrome.com/apps/api_index

Besides, ideologically apps are self-contained and should not interact with the normal browsing.


Update: as indicated by RobW, this is not entirely the case; the API is present (even if that is not documented), but only affects content loaded inside the app, in a <webview> container.

Basically, you still cannot affect normal browsing, but have tools to affect external content used inside your app.

Upvotes: 2

Related Questions