You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

page-inject

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

page-inject

A script to inject html content into a host page

0.0.1
latest
Source
npmnpm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Page Inject

A script to inject html content into a host page

Injects html content into a host page, well treating script elements along the way (if you just do innerHTML scripts display as text nodes). Operates on elements with data-page-inject attribute. Just drop it like this:

<div data-page-inject="path/to/some.html"></div>
<script src="page-inject.js"></script>

Install

yarn add page-inject
# or
npm i -S page-inject

Usage

Host page:

<div data-page-inject="path/to/some.html"></div>
<script src="page-inject.js"></script>

Injected page(some.html):

<div class="some-class">
  some page content
</div>
<script src="some.js"></script>

Result (some.js will be executed):

<div data-page-inject="path/to/some.html">
  <div class="some-class">
    some page content
  </div>
  <script src="some.js"></script>
</div>
<script src="page-inject.js"></script>

FAQs

Package last updated on 15 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts