zoukankan      html  css  js  c++  java
  • chrome中的content script脚本文件

    打开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

  • 相关阅读:
    第三章
    第二章
    第一章
    第九章 硬件抽象层:HAL
    第十章 嵌入式Linux的调试技术
    第八章 让开发板发出声音:蜂鸣器驱动
    第七章
    第六章
    第五章总结
    第四章 源代码的下载和编译
  • 原文地址:https://www.cnblogs.com/simonbaker/p/3662976.html
Copyright © 2011-2022 走看看