Skip to content

Instantly share code, notes, and snippets.

View evanxd's full-sized avatar

Evan Tseng evanxd

View GitHub Profile
@evanxd
evanxd / chrome-migration-utils-usage.js
Created November 15, 2017 07:20
Usage of ChromeMigrationUtils helper functions
Cu.import("resource:///modules/ChromeMigrationUtils.jsm");
(async function () {
console.log(await ChromeMigrationUtils.getExtensionList());
} ());
@evanxd
evanxd / spotlight-plan.md
Last active October 17, 2017 03:02
Firefox Preferences Spotlight Technical Plan
@evanxd
evanxd / visual-refresh-work.md
Created June 28, 2017 22:06
Visual Refresh Work

Visual Refresh

  • Font family, size, color
  • Background color
  • Margin size
  • Web components (checkbox, radio button, input field, button, dropdown menu)
  • Update and add icons/images
    • menu
    • firefox account
    • Bug 1357308: [meta] Add content and images on sub-pages in Preferences
  • Subdialogs (need detail info)
@evanxd
evanxd / mozconfig
Created May 8, 2017 20:03
The mozconfig file for building whole Firefox.
# Define where build files should go. This places them in the directory
# "obj-ff-dbg" under the current source directory
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-ff-dbg
# Enable debug builds
ac_add_options --enable-debug
@evanxd
evanxd / mqtt-hook.md
Last active March 22, 2017 07:29
MQTThook

MQTThook

It is a [MQTT][mqtt] version of [Webhook][webhook] for IoT devices. It helps MQTT-based IoT devices use automation services (e.g. [IFTTT][ifttt] or [Zapier][zapier]) to interact with existed Web applications/services and enrich its capability.

Sample Code

Initialize a MQTThook instance.

var MQTThook = require('mqtthook');
var mqtthook = new MQTThook('mqtt://test.mosquitto.org');
@evanxd
evanxd / readability-js-plan.md
Created January 23, 2017 08:06
Readability.js Plan

Readability.js Plan

Engineering

Make Readability.js more reliable and modularized.

  • Make reader mode button show for top websites.
  • Make reader mode result (more) correct for top websites.
  • Build/refactor reader mode feature as a WebExtensions extension.

Features

Build new features with Readability.js or enhance Reader Mode feature on Firefox.

@evanxd
evanxd / bug-1255978-1.html
Created November 15, 2016 09:54
The List Contains Lots Of Paragraphs Of Text
<ul class="legends">
<li data-gallery-legend="1">
<h2>
<span class="counter">1/50</span>
<!-- Optional photo title -->
United goin down </h2>
<!-- Optional photo caption -->
<p>Manchester United's absence from the Champions League hurt more than the fans' pride last year - it also dented the bottom line. Revenues at the New Uork listed club dipped 8.8 per cent to £395.2m in the year to June, triggering a £1.2 million loss after broadcasting and sponsorship deals dried up. The club said it was now looking to raise $400m from a share issue.</p>
<!-- Optional photo credits -->
<p class="credits">GETTY IMAGES</p>
@evanxd
evanxd / get-expected-result.js
Created November 4, 2016 08:14
Get Expected Result of Readability.js
require("fs").writeFileSync(__dirname + "/test-pages/bug-1173823/expected.html", result.content);
@evanxd
evanxd / opendata-sample.js
Created October 28, 2016 04:07
Sample Code for Querying Data by Date
window.query = (data) => {
return data.filter(function(item) {
return new Date(item.date) > new Date('2016/10/28 11:23:00') &&
new Date(item.date) < new Date('2016/10/28 11:24:00');
});
};
// Please refer to https://dxr.mozilla.org/mozilla-central/source/browser/base/content/tab-content.js#375-393
onPaintWhenWaitedFor: function(forceNonArticle, event) {
if (!event.clientRects.length) {
return;
}
this.cancelPotentialPendingReadabilityCheck();
var t0 = content.performance.now();
var isProbablyReaderable = ReaderMode.isProbablyReaderable(content.document);