Skip to content
Yanis Wang edited this page Jul 10, 2014 · 1 revision

About

You can use the plugin to inject code into webpage.

Config

pagerun.setConfig({
	inject: {
		top: '<script>console.log("top")</script>',
		header: '<script>console.log("header")</script>',
		body: '<script>console.log("body")</script>',
		footer: '<script>console.log("foot")</script>'
	}
};

Three inject position:

  1. top : inject after <head>
  2. header : inject before </head>
  3. body : inject after <body>
  4. footer : inject before </body>

Api in node

  1. pagerun.injectCode(code, position)

    Inject code at end of code array.

  2. pagerun.injectCodeBefore(code, position)

    Inject code at first of code array.

Clone this wiki locally