12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- 'use strict';
- /**
- Part of Zombie Navigator
- Copyright © 2016 Zombie Navigator Developers
-
- @file
- @license AGPL-3.0+
- */
- /*
- Zombie script example (= unprivileged)
- Do NOT require () this script from the addon code.
- */
- const consoleType = typeof console;
- do {
- const {zombie, console} = require('zombie/zombie');
- const {openWindow, openPrivateWindow, closeAll} = require('zombie/webbrowser');
- const {run, delay} = require('zombie/async');
- console.log('console:', consoleType);
- run(function* () {
- let w = yield openPrivateWindow('about:');
-
- console.log(w);
- console.log(w.uri);
- yield w.runScript(function () {
- location.href = 'about:config';
- console.log (typeof window.wrappedObject);
- });
-
- yield w.waitForReload();
- console.log(w.uri);
-
- // unprivileged URI
- w.uri = 'data:,';
- yield w.waitForReload();
- console.log(w.uri);
-
- yield w.runScript(function () {
- location.href = 'about:config'; // denied
- });
-
- // this doesn't happen
- yield w.waitForReload();
- console.log(w.uri);
- });
- } while (false);
- // vim: ts=4 noet ai
|