method-runScript 394 B

12345678910111213141516
  1. runScript (function callback [, ... * args]) : {Promise -> *}
  2. Run a script inside this window (tab)
  3. Parameters:
  4. {function} callback : The script to run
  5. {*} ... args : Passed to the callback (optional)
  6. Returns:
  7. Resolves to the result of the callback
  8. let promise = w.runScript(function (arg1, arg2) {
  9. console.log(document.title);
  10. return 'result';
  11. }, 'arg1', 'arg2');
  12. # vim: ts=4 noet ai