我以编程方式在网页中设置 iframe 的 URL。我必须知道此 URL 更改会触发哪些 http 请求(CSS、脚本、图像等加载的 URL)。我拦截了 XMLHttpRequest,但这个对象从未被调用过......
如何拦截这些http请求?
是否有另一种方法来“加载” iframe 并获取所有触发的 URL 请求?
这是我的代码:
(function(xhr){
var pt = xhr.prototype;
pt._open = pt.open;
pt.open = function(){
console.log('Open called...');
this._open.apply(this, arguments);
})(XMLHttpRequest);
...
$('#iframe').attr('src', 'http://www.stackoverflow.com');
Run Code Online (Sandbox Code Playgroud) 我想在我的 iMac 上安装“zammad”(请参阅https://docs.zammad.org/en/latest/install/source.html)但失败了。
错误信息如下:
An error occurred while installing libv8 (6.7.288.46.1), and Bundler cannot continue.
Make sure that `gem install libv8 -v '6.7.288.46.1' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
mini_racer was resolved to 0.2.4, which depends on
libv8
Run Code Online (Sandbox Code Playgroud)
我尝试了各种方法都没有成功。我基于自制软件的最后一种方法:
通过自制软件安装v8@3.15(参见https://formulae.brew.sh/formula/v8)
brew install v8@3.15
设置路径和编译器标志
echo 'export PATH="/usr/local/opt/v8@3.15/bin:$PATH"' >> ~/.zshrc
export LDFLAGS="-L/usr/local/opt/v8@3.15/lib"
export CPPFLAGS="-I/usr/local/opt/v8@3.15/include"
通过 gem开始安装
gem install libv8 -v '6.7.288.46.1' -V -- --with-system-v8
安装失败并显示以下错误消息:
Error: …Run Code Online (Sandbox Code Playgroud)