Google chrome extension 在Chrome应用程序中重定向URL?

Google chrome extension 在Chrome应用程序中重定向URL?,google-chrome-extension,google-chrome-app,Google Chrome Extension,Google Chrome App,有了Chrome扩展就可以了,但有了Chrome应用就可以了 chrome.webRequest.onBeforeRequest.addListener(function (info) { return {redirectUrl: "http://www.newurl.com/file.js"}; }, { urls: ["*://www.originalurl.com/file.js"] }, ["blocking"]); 不,这是不可能的 应用程序中支持的API列表: 此外

有了Chrome扩展就可以了,但有了Chrome应用就可以了

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

不,这是不可能的

应用程序中支持的API列表:

此外,意识形态上的应用程序是独立的,不应该和正常的浏览交互


更新:如RobW所示,情况并非完全如此;API是存在的(即使没有文档记录),但只影响应用程序内部
容器中加载的内容


基本上,您仍然无法影响正常浏览,但有一些工具可以影响应用程序中使用的外部内容。

Chrome应用程序支持
webRequest
API,但仅适用于应用程序中的网络活动。@RobW这是有意义的。你能把它做成一个答案吗?请随意编辑成你的答案。我认为OP是在询问是否可以在应用程序中使用WebRequestAPI来获得常规浏览配置文件中活动的通知。你正确地回答了那个案子的问题。