简体   繁体   English

Chrome扩展程序的内容脚本如何确定注入页面的引荐来源网址?

[英]How can a Chrome extension's content script determine the injected page's referrer?

What is the best way to determine a page's referrer within the context of a content script in a Chrome extension? 在Chrome扩展程序中的内容脚本的上下文中确定页面引荐来源网址的最佳方法是什么?

It looks possible to intercept requests' headers using the chrome.webRequest module, but it would then take some book-keeping and message-passing in order to get it into the content script. 看起来可以使用chrome.webRequest模块拦截请求的标头,但随后需要进行簿记和消息传递才能将其放入内容脚本中。

That approach feels kludgy. 这种方法让人感到困惑。 Is there a better way? 有没有更好的办法?

怎么样document.referrer

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Chrome扩展程序的内容脚本未注入特定网站 - Chrome extension's content script not getting injected on specific websites 从chrome扩展的内容脚本动态注入jQuery后,为什么不能使用jQuery? - Why can't I use jQuery after it's dynamically injected from a chrome extension's content-script? 如何在后台获取chrome扩展程序的内容脚本? - How can I get chrome extension's content script to in the background? 如何确定Chrome扩展程序是否位于内容脚本的弹出窗口中? - How can I determine if a Chrome extension is in a popup from the content script? 为什么我的 chrome 扩展内容脚本无法访问页面元素的属性? - Why can't my chrome extension content script have access to a page element's property? 如何从 Chrome 扩展程序中获取当前选项卡的引荐来源网址? - How to get the current tab's referrer from a Chrome extension? 网站的javascript完成页面构建后,如何运行Chrome扩展程序内容脚本? - How do I run Chrome extension content script after a site's javascript has finished building page? 如何从Chrome扩展程序的选项页面启用/禁用manifest.json CSS内容脚本? - How to enable/disable manifest.json CSS content script from Chrome Extension's options page? 如何在Chrome扩展程序的内容脚本中将事件监听器添加到Google表格链接? - How can I add event Listener to google sheets link in chrome extension's content script? Chrome 扩展:注入按钮的 onclick 不起作用 - Chrome Extension: Injected button's onclick not working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM