google-chrome - OnHistoryStateUpdated 仅在访问 Facebook 时创建 chrome 扩展
问题描述
代码在多次使用on-updated事件后改成这个代码。OnHistoryStateUpdated究竟是什么条件?
背景.js
chrome.webNavigation.onHistoryStateUpdated.addListener(function (details) {
var domain = details.url;
var google = 'https://www.google.co.kr/';
var xhr = new XMLHttpRequest();
xhr.onload = function () {
if (xhr.status === 200 || xhr.status === 201) {
console.log(xhr.responseText);
} else {
console.error(xhr.responseText);
}
};
xhr.open('POST', 'http://soylatte.kr:3000/image/check');
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send('url=' + domain);
})
解决方案
推荐阅读
- python - 使用 win32com 单击命令按钮
- r - R - 通过匹配相同前缀上的值来处理字符变量,同时截断 data.table 中的发散后缀
- python - Pandas:如何将具有 5 列的数据框转换为具有相同值但其他格式的另一个数据框?
- node.js - Mongoose - 无法读取未定义的属性“[任何函数]”
- uml - 关于类图中有向关联链接的问题
- php - 如何将 WPForms 数据传递给 Woocommerce Checkout Form?
- database - arangodb 锁定文件问题
- reactjs - 反应原生矢量图标 ios 图标不会出现在发布时
- .htaccess - htaccess 目录管理
- java - 我的 jacoco 测试报告中缺少哪些分支?