Skip to content

Instantly share code, notes, and snippets.

View rpl's full-sized avatar

Luca Greco rpl

  • Mozilla
  • Lecce, Italy
View GitHub Profile
@rpl
rpl / README.md
Created May 31, 2022 08:36
jscodeshift transform script used to rewrite import statements to fix incompatibility with nodejs native ES module loader

transform-add-ext-to-local-imported-modules.cjs is a small jscodeshift transformer which rewrites relative paths in the static import statements to fix an incompatibility with the nodejs native ES module loader (which requires a file extension for imports using related paths).

npx jscodeshift --parser=babylon -t transform-add-ext-to-local-imported-modules.cjs tests/functional/test.typo.run.js
@rpl
rpl / install-addon.html
Created April 4, 2022 20:31
Self-distribuited addon install test page
<!DOCTYPE html>
<html>
<head>
<title>Self-distribuited addon install</title>
<meta charset="utf-8">
</head>
<body>
<h1>Self-distribuited addon install</h1>
@rpl
rpl / logs-webRequest-intercepted-requests-on-browser-restart-restore-pinned-slacktab.txt
Created April 1, 2022 19:55
Logs collected while investigating possible relation between webRequest WebExtensions API and Bug 1752655
LOGPOINT webRequest event onBeforeRequest requestId: 15 tabId: 1 type: font url: https://b.slack-edge.com/bv1-9/slack-icons-v2-fe043a5.woff2 ext-webRequest.js:38:4
LOGPOINT webRequest event onBeforeRequest requestId: 16 tabId: 1 type: font url: https://b.slack-edge.com/bv1-9/lato-regular-d9ce515.woff2 ext-webRequest.js:38:4
LOGPOINT webRequest event onBeforeRequest requestId: 17 tabId: 1 type: font url: https://b.slack-edge.com/bv1-9/lato-black-b64f5e4.woff2 ext-webRequest.js:38:4
LOGPOINT webRequest event onBeforeRequest requestId: 18 tabId: 1 type: font url: https://b.slack-edge.com/bv1-9/lato-bold-4b1dc11.woff2 ext-webRequest.js:38:4
LOGPOINT webRequest event onHeadersReceived requestId: 17 tabId: 1 type: font url: https://b.slack-edge.com/bv1-9/lato-black-b64f5e4.woff2 ext-webRequest.js:38:4
LOGPOINT webRequest event onHeadersReceived requestId: 18 tabId: 1 type: font url: https://b.slack-edge.com/bv1-9/lato-bold-4b1dc11.woff2 ext-webRequest.js:38:4
LOGPOINT webRequest event
changeset: 614313:f9729039d78d
parent: 614310:cd9488c30f8e
user: Luca Greco <lgreco@mozilla.com>
date: Tue Mar 29 14:28:17 2022 +0200
summary: TMP changes due to rebase and conflicts resolution
diff --git a/toolkit/components/extensions/parent/ext-backgroundPage.js b/toolkit/components/extensions/parent/ext-backgroundPage.js
--- a/toolkit/components/extensions/parent/ext-backgroundPage.js
+++ b/toolkit/components/extensions/parent/ext-backgroundPage.js
@@ -486,6 +486,12 @@ this.backgroundPage = class extends Exte
diff --git a/README.md b/README.md
index 3433d54..bcade89 100644
--- a/README.md
+++ b/README.md
@@ -121,25 +121,7 @@ You are able to execute command functions without any argument validation. If yo
// or...
import webExt from 'web-ext';
-// If you would like to run an extension on Firefox for Android:
-
@rpl
rpl / ExtensionBrowser.cpp
Last active August 20, 2020 12:12
WebExtensions API WebIDL bindings - ExtensionBrowser and Desktop only API namespaces
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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/. */
#include "ExtensionBrowser.h"
...
// Include headers for the API namespaces shared by mobile and desktop builds.
diff --git a/toolkit/components/extensions/schemas/storage.json b/toolkit/components/extensions/schemas/storage.json
--- a/toolkit/components/extensions/schemas/storage.json
+++ b/toolkit/components/extensions/schemas/storage.json
@@ -155,6 +155,135 @@
]
}
]
+ },
+ {
+ "id": "StorageAreaSync",
@rpl
rpl / .gitignore
Last active October 24, 2019 20:31
npm audit failure - "The server said: Invalid package tree, run npm install to rebuild your package-lock.json"
node_modules
@rpl
rpl / .hgrc
Last active June 21, 2019 23:20
some useful mercurial aliases
[revsetalias]
# pending commits (used in `hg lg` and `hg lgs aliases`)
pending = ancestors(.)&draft()
# recent bookmarks (used in `hg rbm` alias)
recent_bookmarks($1) = limit(reverse(sort(bookmark())), $1)
[alias]
# log only pendings commits
lg = log -r 'pending'
@rpl
rpl / 1-Bug_1285500___Fix_browser_ext_browserAction_popup_intermittency_when_browserAction_is_placed_in_the_overflow_menu_.patch
Created February 27, 2019 19:02
Avoid await on promiseDocumentFlushed when the browserAction is placed in the overflow menu
# HG changeset patch
# User Luca Greco <lgreco@mozilla.com>
# Date 1551125488 -3600
# Mon Feb 25 21:11:28 2019 +0100
# Node ID 42519936d019a00bd9ea52dcb6acf98a7545412b
# Parent 198cd4a81bf2afa7cc79360f90da7bc91218b76d
Bug 1285500 - Fix browser_ext_browserAction_popup intermittency when browserAction is placed in the overflow menu.
diff --git a/browser/components/extensions/ExtensionPopups.jsm b/browser/components/extensions/ExtensionPopups.jsm
--- a/browser/components/extensions/ExtensionPopups.jsm