严重吐槽一下CSDN的blog,卧槽,我好不容易写完一篇,点完发表之后就一直loading,然后就让我登陆,然后就特么什么都没有了!!!!!
好了,重新写一遍吧。
发现问题
chrome扩展的content scripts是不能直接访问web pages中的scripts的变量和函数的。一个小需求,让我发现了这个问题,官网描述如下:
Here are some examples of what content scripts can do:
Find unlinked URLs in web pages and convert them into hyperlinks
Increase the font size to make text more legible
Find and process microformat data in the DOM
However, content scripts have some limitatio这里写代码片
ns. They cannot:
Use chrome.* APIs, with the exception of:
extension ( getURL , inIncognitoContext , lastError , onRequest , sendRequest )
i18n
runtime ( connect , getManifest , getURL , id , onConnect , onMes