Skip to content
This repository was archived by the owner on May 17, 2023. It is now read-only.

ReeganExE/chrome-script-execution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

From Chrome v32, it supports Promise. It's easy to chrome.tabs.executeScript multiple scripts.

Usage example:

new ScriptExecution(tab.id)
    .executeScripts("js/jquery.js", "js/script.js")
    .then(s => s.executeCodes('console.log("executes code...")'))
    .then(s => s.injectCss("css/style.css"))
    .then(s => console.log('done'));

OR

let executer = new ScriptExecution(tab.id);

executer.executeScripts("js/jquery.js", "js/script.js")
    .then(s => s.executeCodes('console.log("executes code...")'))
    .then(s => s.injectCss("css/style.css"))
    .then(s => console.log('done'));

More info: http://stackoverflow.com/questions/21535233/injecting-multiple-scripts-through-executescript-in-google-chrome/34456163#34456163

About

A util for executing mutiple scripts on Chrome Extension

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published