首页 > 其他 > 详细

chrome中的content script脚本文件

时间:2014-04-14 10:17:15      阅读:575      评论:0      收藏:0      [点我收藏+]

打开chrome的devtools工具,sources下有一个Content script:

1 chrome插件开发过程中难免会遇到使用content script来操作页面的dom,在chrome官方文档中有关于content script的一些说明:

“Content scripts are JavaScript files that run in the context of web pages. By using the standard Document Object Model (DOM), they can read details of the web pages the browser visits, or make changes to them.”

由于content script运行在称之为“隔离环境”的特殊环境中,虽然它能够对页面的dom进行直接访问及操作,但对页面上的js变量及函数却无法进行访问,反过来也是如此,content_script处在一个闭环的空间中,与世隔绝。

 

可参考:

http://gmeiz.me/blog/chrome%E6%89%A9%E5%B1%95%E5%BC%80%E5%8F%91%E6%9D%82%E8%AE%B0-content-script%E7%94%A8%E6%B3%95

http://open.chrome.360.cn/html/dev_content_scripts.html

chrome中的content script脚本文件,布布扣,bubuko.com

chrome中的content script脚本文件

原文:http://www.cnblogs.com/simonbaker/p/3662976.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!