javascript - 在 chrome 错误页面上时,有什么方法可以从多功能框中获取真实的 url?
问题描述
我目前正在尝试制作一个扩展程序,该扩展程序将自动取消挂起曾经被大吊带挂起的标签。
function unsuspend() {
if(document.location.href.startsWith("chrome-extension") &&
document.location.href.indexOf("/suspended.html#") > -1) {
unsuspendurl = document.location.href.substr(document.location.href.lastIndexOf("&uri=")+5);
return unsuspendurl;
}
}
问题是,当卸载扩展程序时,您会得到一个错误页面,即文档 (chrome-error://chromewebdata/)。
我试图找到是否有人有办法获取多功能框文本但没有运气。
解决方案
我认为扩展程序无法访问其他扩展程序页面。所以我不得不半自动地做这个来解决这个问题:) https://gist.github.com/JLar ky/0385d22305c86ed5ca05b254a1e902ac
推荐阅读
- java - h2 数据库以及其他数据源
- angular - 如何有条件地在 Angular 2+ 中包含第三方 JS(基于环境)
- batch-file - PuTTY psftp 从部分名称获取文件
- hibernate - 基于类的投影 (DTO) id 不工作,但基于接口的投影工作
- php - 使多个单元并排fpdf
- rest - REST API 的 Junit 测试用例
- wordpress - 在 /blog 下创建带有链接的 WordPress 帖子
- android - 当我添加工具时发生了什么:replace="android:appComponentFactory"
- ajax - MVC 控制器从 ajax 接收空值
- karate - 尝试在 KARATE DSL 中进行后调用时如何解决“错误 com.intuit.karate - http 请求失败:null”?