Current handle sender.tab for background pages

This commit is contained in:
Cheng Zhao 2016-05-29 10:46:48 +09:00
parent dd804d7432
commit 2431d886bf
4 changed files with 51 additions and 24 deletions

View file

@ -13,7 +13,7 @@ const matchesPattern = function (pattern) {
// Run the code with chrome API integrated.
const runContentScript = function (extensionId, url, code) {
const context = {}
require('./chrome-api').injectTo(extensionId, context)
require('./chrome-api').injectTo(extensionId, false, context)
const wrapper = `(function (chrome) {\n ${code}\n })`
const compiledWrapper = runInThisContext(wrapper, {
filename: url,