Skip to content
This repository has been archived by the owner on Jun 17, 2019. It is now read-only.

Latest commit

 

History

History
18 lines (12 loc) · 549 Bytes

README.md

File metadata and controls

18 lines (12 loc) · 549 Bytes

This project has been merged into the vk-x monorepo

inject

For use inside Chrome extensions. Injects scripts into the page context.

inject = require("@vk-x/inject")

// File name will be resolved with chrome.extension.getURL()
inject("path/to/file.js")

// Pass true as the second argument to inject the string itself as code.
inject("console.log('Inline code')", true)

// Functions are automatically stringified and wrapped into an IIFE.
inject(function() { console.log("I'm injected!") })