Labs/Jetpack/Reboot に関してメモ
- main.js には Components は使えない
Error: Permission denied for moz-nullprincipal:{8d6c05eb-fc08-436a-adaa-f440a732c337} to get property XPCComponents.classes - まだ全容がつかめない
{
| let INFO = | |
| <plugin name="jetpackHack" version="1.0" | |
| href="http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/jetpackHack.js" | |
| summary="enable to access to Jetpack inner context" | |
| xmlns="http://vimperator.org/namespaces/liberator"> | |
| <author email="[email protected]">teramako</author> | |
| <license>BSD</license> | |
| <project name="Vimperator" minVersion="2.2"/> | |
| <p>Example: list executing Jetpack feature</p> | |
| <code> |
| //テーマはvar, letを使わないこと | |
| (function(n,c) | |
| c.substr(0,c.length-c.length%n).split("").reduce( | |
| function(p,c,i){ | |
| p[i%n]+=c; | |
| return p; | |
| }, | |
| Array.apply("",Array(n)).map(function()"") | |
| ).toSource() | |
| )(4,"111122233445a") |
| var root = io.File("~/hoge"); | |
| var target = io.File("~/var"); | |
| var path=""; | |
| while (root.parent){ | |
| print(root.path); | |
| if (target.path.indexOf(root.path) == 0){ | |
| break; | |
| } | |
| root = root.parent; |
| // ==UserScript== | |
| // @name tumblrDashboardSetPublicLink | |
| // @namespace http://d.hatena.ne.jp/teramako/ | |
| // @include http://www.tumblr.com/dashboard | |
| // @include http://www.tumblr.com/tagged/* | |
| // @author teramako | |
| // @license MIT | |
| // ==/UserScript== | |
| let postLength = "post".length; |
| jetpack.future.import("slideBar"); | |
| let NS = { | |
| xhtml: "http://www.w3.org/1999/xhtml", | |
| xul: "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", | |
| }; | |
| function nsResolver(prefix){ | |
| return NS[prefix] || null; | |
| } | |
| function evaluate(xpath, elm){ |
| // http://gyazo.com/39e1c43d0529375b589843b9e20d26ed.png | |
| - Jetpack | |
| - Jetpackの制限 | |
| 可能かどうか | |
| - ショートカットキー | |
| グローバルなショートカットキーのフックは可能? | |
| Documentのイベントリスナーで実装する場合、画像ページでもショートカットキーは有効? |
Labs/Jetpack/Reboot に関してメモ
{
| // ==UserScript== | |
| // @name twitter disable icon | |
| // @namespace http://d.hatena.ne.jp/teramako | |
| // @description dont display user icon | |
| // @include http://twitter.com/* | |
| // ==/UserScript== | |
| function insertRule(selector, declarations){ | |
| var sheets = document.styleSheets; | |
| var lastSheet = sheets[sheets.length-1]; |
| function Hoge(){ | |
| if (this instanceof arguments.callee){ | |
| return this; | |
| } | |
| return new arguments.callee; | |
| } | |
| Hoge.prototype = { | |
| foo: "foo", | |
| bar: "bar" | |
| }; |