【发布时间】:2017-01-31 20:51:06
【问题描述】:
我需要拦截对特定服务器的第一个请求,让它成为http://google.com,而不是在当前选项卡的根目录中渲染它,而是创建一个包含两个iframes的页面,在第一个iframe将被渲染最初请求的站点http://google.com,在第二个中将呈现让我们说http://bing.com。
我需要这样的东西:
<!DOCTYPE html>
<html>
<body>
<iframe src="http://www.google.com">
<p>Your browser does not support iframes.</p>
</iframe>
<iframe src="http://www.bing.com">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
其实我知道如何拦截第一个请求:
chrome.webRequest.onBeforeRequest.addListener(
function(details)
{
console.log(details.requestBody);
},
{urls: ["*://google/*"]},
['requestBody']
);
但是接下来要做什么呢?
【问题讨论】:
标签: jquery html google-chrome iframe google-chrome-extension