javascript - 加载页面而不从 devtools 中刷新窗口对象
问题描述
我想从 devtools 中加载一个具有以下特征的页面
const x = 10;
window.location = "http://google.com";
// wait for the page to load
console.log(x); // undefined :( I want to see '10' here!!
我也试过
history.replaceState(null,null, 'https://google.com')
但这给出了一个错误
如果有 chrome 设置允许这样做,那对我也有用!
有什么建议么?
解决方案
推荐阅读
- jquery - 如何将活动链接添加到引导程序 4 垂直菜单
- python - 在 Python 中导入库时出现分段错误
- python - 使用基于主机的身份验证没有密码的 Paramiko ssh
- node.js - Comodo SSL 证书捆绑安装 Node.js / Express
- python - TypeError:“模块”对象在 Django 中不可调用
- php - 将 url 中的 %20 替换为 "_" .htaccess
- r - 如何使用 gsub 将 's 替换为 's 仅用于数据集的一列?
- python - 如何将烧瓶默认 http 方法从 GET 更改为 POST
- amazon-web-services - 为什么我们启动或停止 Ec2 服务时 IP 地址会发生变化?
- python - Django 扩展的 UserProfile 模型没有保存我的额外信息