Skip to content

Instantly share code, notes, and snippets.

View daleharvey's full-sized avatar

Dale Harvey daleharvey

View GitHub Profile
const s = window.document.createElement("script");
s.type = "text/javascript";
s.src = URL.createObjectURL(new Blob([`let { UrlbarShared } = ChromeUtils.importESModule("chrome://browser/content/urlbar/UrlbarShared.mjs", { global: "current" })`]));
window.document.body.append(s);
let newUrlbarShared = window.wrappedJSObject.UrlbarShared;
0:09.50 INFO Console message: [JavaScript Error: "Content-Security-Policy: The page’s settings blocked a script (script-src-elem) at blob:system/932bd218-6c11-43d7-a44d-2d0cb2705466 from being executed because it violates the following directive: “script-src chrome: resource: moz-src:”" {file: "chrome://mochitests/content/browser/browser/components/urlbar/tests/browser-results/browser_result_explanations.js" line: 246}]
console.log("!!!! Loading");
//var { UrlbarShared } = ChromeUtils.importESModule("chrome://browser/content/urlbar/UrlbarShared.mjs", { global: "current" });
const UrlbarShared = await import("chrome://browser/content/urlbar/UrlbarShared.mjs");
let sandbox = sinon.createSandbox();
let formatDateStub = sandbox.stub(UrlbarShared, "formatDate");
FAIL lastVisited - Uncaught exception in test - TypeError: ES Modules cannot be stubbed
> file:///Users/dale/src/palmtree-result-extension/src/experiments/urlbar/mozTrie.jsm - EXPORTED_SYMBOLS is not an array.
$ cat /Users/dale/src/palmtree-result-extension/src/experiments/urlbar/mozTrie.jsm
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const EXPORTED_SYMBOLS = [ "Foo" ];
function Foo() {
queryScorer.addDocument({
id: "fubar",
phrases: [
"home decor",
"home decoration",
"home decoration ideas",
"home decor stores"
]
})
~/src/gecko/browser/components/newtab (master)$ ./bin/try-runner.js
bash: ./bin/try-runner.js: Permission denied
~/src/gecko/browser/components/newtab (master)$ node ./bin/try-runner.js
TEST START | checkBundles
/Users/dale/src/gecko/browser/components/newtab/node_modules/node-sass/lib/binding.js:13
throw new Error(errors.unsupportedEnvironment());
^
Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (83)
For more information on which environments are supported please see:
async _ensureRegionFilesSynced() {
log.info("_ensureRegionFilesSynced");
this._remoteSettings.on("sync", async ({ data: { deleted } }) => {
log.info("_ensureRegionFilesSynced sync event");
const toDelete = deleted.filter(d => d.attachment);
// Remove local files of deleted records
await Promise.all(
toDelete.map(entry => this._remoteSettings.attachments.delete(entry))
);
this._ensureRegionFilesDownloaded();
async _ensureRegionFilesDownloaded() {
log.info("_ensureRegionFilesDownloaded");
this._remoteSettings.on(
"sync",
async ({ data: { created, updated, deleted } }) => {
log.info("_ensureRegionFilesDownloaded data synced");
const toDelete = deleted.filter(d => d.attachment);
const toDownload = created
.concat(updated.map(u => u.new))
.filter(d => d.attachment);
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-env mozilla/chrome-worker */
"use strict";
importScripts("resource://gre/modules/workers/require.js");
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)
File "/Users/dale/src/gecko/python/mozbuild/mozbuild/artifact_commands.py", line 335, in artifact_toolchain
task, {}, task.optimization.get('index-search', []))
File "/Users/dale/src/gecko/taskcluster/taskgraph/optimize/strategies.py", line 37, in should_replace_task
task_id = find_task_id(index_path)
File "/Users/dale/src/gecko/taskcluster/taskgraph/util/taskcluster.py", line 181, in find_task_id
response = _do_request(get_index_url(index_path))
File "/Users/dale/src/gecko/taskcluster/taskgraph/util/taskcluster.py", line 104, in _do_request
response = session.get(url, stream=True, **kwargs)
~$ pip install --upgrade pip
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):