Git Product home page Git Product logo

content-scripts's Introduction

chrome extension: 
	"A simple content scripts example."
2016/2/24
[MonkandMokey]
------------------------------------------
chrome extension has 3 main kinds: 
	1. browser action
	2. page action
	3. content scripts
This example is a content scripts. Which means it works in the background.
For more details, you can find in chrome extension's official documents.
---------------------------------------------------------------------------
Function:
	Get the tagname of the focus DOM element which is being clicked.
	There will be an alert popup, and the DOM element will change its background color into orange.
--------------------------------------------------------------------------------
Note:
	* In manifest.json, you can choose the websites which will allow the extension to run. 
	  eg: "matches":["http://news.163.com/*"]
	* Sometimes the CSP(content security policy) will bring you some limitation in your javascript. When it happens, look for the chrome extension's document for help.
	  You may need to change your code a little bit. Chrome did all these for better security.
------------------------------------------------
File Lists:
	* manifest.json: 
		List the files' name so that chrome will find them.
		Assign the attributes that needed.
	* popup.js:
		The function and logic is reliazed here.
		

content-scripts's People

Contributors

monkandmonkey avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.