uri_references.js 970 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. 'use strict';
  2. /**
  3. Part of Zombie Navigator
  4. Copyright © 2015 Zombie Navigator Developers
  5. @file
  6. @license AGPL-3.0+
  7. */
  8. /*
  9. Zombie script example (= unprivileged)
  10. Do NOT require () this script from the addon code.
  11. */
  12. const {zombie, console} = require('zombie/zombie');
  13. const {openWindow, openPrivateWindow, closeAll} = require('zombie/webbrowser');
  14. const {run, delay} = require('zombie/async');
  15. run(function* () {
  16. let w = yield openWindow('invalid://authority/');
  17. console.log(w.uri);
  18. yield delay(2);
  19. w.uri = '//authority2/';
  20. yield w.waitForReload();
  21. console.log(w.uri);
  22. yield delay(2);
  23. w.uri = '/path/to/dir';
  24. yield w.waitForReload();
  25. console.log(w.uri);
  26. yield delay(2);
  27. w.uri = '../path2/';
  28. yield w.waitForReload();
  29. console.log(w.uri);
  30. yield delay(2);
  31. w.uri = '../../../../../././../.#foobar?';
  32. yield w.waitForReload();
  33. console.log(w.uri);
  34. yield delay(2);
  35. yield closeAll();
  36. console.log('closed');
  37. });
  38. // vim: ts=4 noet ai