Skip to content

Instantly share code, notes, and snippets.

diff --git a/_libly.js b/_libly.js
index 9626b54..5a5d583 100644
--- a/_libly.js
+++ b/_libly.js
@@ -247,7 +247,7 @@ libly.$U = {//{{{
let pluginPath;
Error('hoge').stack.split(/\n/).some(
function (s)
- let (m = s.match(/-> liberator:\/\/template\/chrome:\/\/liberator\/content\/liberator\.js -> (.+):\d+$/))
+ let (m = s.match(/(?:-> liberator:\/\/template\/)?chrome:\/\/liberator\/content\/liberator\.js -> (.+):\d+$/))
@caisui
caisui / a.patch
Last active August 29, 2015 14:05
diff --git a/common/content/completion.js b/common/content/completion.js
index fbbfdef..8ab68e7 100644
--- a/common/content/completion.js
+++ b/common/content/completion.js
@@ -208,7 +208,13 @@ const CompletionContext = Class("CompletionContext", {
__proto__: item
}));
});
- return { start: minStart, items: util.Array.flatten(items), longestSubstring: this.longestAllSubstring
+ return { start: minStart, items: util.Array.flatten(items),
diff --git a/common/content/javascript.js b/common/content/javascript.js
index 5d18212..4d9d789 100644
--- a/common/content/javascript.js
+++ b/common/content/javascript.js
@@ -637,8 +637,10 @@ const JavaScript = Module("javascript", {
options.add(["inspectcontentobjects"],
"Allow completion of JavaScript objects coming from web content. POSSIBLY INSECURE!",
"boolean", false);
- options.add(["expandtemplate"],
- "Expand TemplateLiteral",
from http.server import SimpleHTTPRequestHandler, test
class CSPHTTPRequestHandler(SimpleHTTPRequestHandler):
def end_headers(self):
self.send_header('Content-Security-Policy', "default-src 'self'")
super(CSPHTTPRequestHandler, self).end_headers()
if __name__ == '__main__':
test(HandlerClass=CSPHTTPRequestHandler)
diff --git a/vimperator/content/config.js b/vimperator/content/config.js
--- a/vimperator/content/config.js
+++ b/vimperator/content/config.js
@@ -7,6 +7,15 @@
const Config = Module("config", ConfigBase, {
init: function () {
+ // XXX: for Australis
+ var vc = Cc["@mozilla.org/xpcom/version-comparator;1"].getService(Ci.nsIVersionComparator);
+ if (vc.compare(Application.version, "28.0a1") === 0) {
" vimperator ex
augroup javascriptT
au!
function JavaScriptSyntaxEx()
if match(expand("%:p"), "/vimperator/") >= 0
syntax region javaScriptStringT start="[a-z]*`" end="`" contains=javaScriptSpecial,@htmlPreproc
syntax region javaScriptStringT1 matchgroup=javaScriptStringTBraces start="${" end="}" contains=TOP,javaScriptBraces contained containedin=javaScriptStringT
syntax region javaScriptStringT2 matchgroup=javaScriptBraces start="{" end="}" contains=TOP,javaScriptBraces contained containedin=javaScriptStringT1,javaScriptStringT2
hi link javaScriptStringT String
hi link javaScriptStringTBraces Special
@caisui
caisui / p1.diff
Last active December 16, 2015 08:18
diff --git a/common/content/util.js b/common/content/util.js
--- a/common/content/util.js
+++ b/common/content/util.js
@@ -797,11 +797,46 @@
}
return dom.childNodes.length === 1 ? dom.childNodes[0] : dom;
},
- domToStr: function domToStr(node) {
- var enc=Cc["@mozilla.org/layout/documentEncoder;1?type=text/plain"].getService(Ci.nsIDocumentEncoder);
- enc.init(node.ownerDocument, "text/html", 0);
@caisui
caisui / p1.diff
Last active December 16, 2015 06:59
diff --git a/common/content/util.js b/common/content/util.js
--- a/common/content/util.js
+++ b/common/content/util.js
@@ -782,12 +782,12 @@
* @see util.xmlToDom
*/
xmlToDomForTemplate: function xmlToDomForTemplate(node, doc, nodes) {
- var dom = doc.createDocumentFragment();
var range = doc.createRange();
var fragment = range.createContextualFragment(
(function () {
const EOF = {};
function iterLine(source) {
source += "\n";
var re = /\r\n?|\n/g;
var m;
var line = 1;
var offset = 0;
while (m = re.exec(source)) {
yield [line++, source.substring(offset, m.index)];
diff --git a/common/modules/template.js b/common/modules/template.js
--- a/common/modules/template.js
+++ b/common/modules/template.js
@@ -1,10 +1,6 @@
var EXPORTED_SYMBOLS = ["convert"];
const Cu = Components.utils;
-gDebugOutput = false;
-var scope = {};
-Cu.import("resource://gre/modules/Services.jsm", scope);