amo-example.js 473 B

12345678910111213141516171819
  1. const {console} = require('zombie/zombie');
  2. const {closeAll, openPrivateWindow} = require('zombie/webbrowser');
  3. require('zombie/async').run(function* () {
  4. // Private browsing
  5. let window = yield openPrivateWindow('https://en.wikipedia.org/');
  6. console.log(window.uri);
  7. // Examine cookies
  8. let cookies = yield window.runScript(message => {
  9. alert(message);
  10. return document.cookie;
  11. }, 'Hello, world!');
  12. console.log(cookies);
  13. closeAll();
  14. });
  15. // vim: ts=4 noet ai