Inject chrome.* to content scripts

This commit is contained in:
Cheng Zhao 2016-05-28 15:37:44 +09:00
parent d8db695712
commit f5b430d9e1
4 changed files with 56 additions and 33 deletions

View file

@ -63,7 +63,7 @@ if (window.location.protocol === 'chrome-devtools:') {
nodeIntegration = 'true'
} else if (window.location.protocol === 'chrome-extension:') {
// Add implementations of chrome API.
require('./chrome-api')
require('./chrome-api').injectTo(window.location.hostname, window)
nodeIntegration = 'true'
} else {
// Override default web functions.