Skip to content

Commit

Permalink
inject-to-document accepts strigified function
Browse files Browse the repository at this point in the history
  • Loading branch information
petemill committed Sep 14, 2020
1 parent 469fbae commit 482a7c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/contentScript/inject-to-document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// you can obtain one at http://mozilla.org/MPL/2.0/.

export default function injectToDocument (isolatedFn: Function, ...codeVars: any[]) {
export default function injectToDocument (isolatedFn: Function | string, ...codeVars: any[]) {
// Convert function to single-scope and stringify
const codeToEval = `(
${isolatedFn.toString()}
Expand Down

0 comments on commit 482a7c2

Please sign in to comment.