mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-18 21:15:45 +01:00
Compare commits
16 Commits
dactyl-mas
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| d4b7e64470 | |||
|
|
0a05e0089b | ||
|
|
00536f5feb | ||
|
|
4b81d89a3e | ||
|
|
9069da69e6 | ||
|
|
834077f282 | ||
|
|
864482cd7b | ||
|
|
0a46c4be52 | ||
|
|
1910720de8 | ||
|
|
44563c4a85 | ||
|
|
7f44847ee3 | ||
|
|
1d68b97ae6 | ||
|
|
16a449a161 | ||
|
|
c8bacf3c71 | ||
|
|
6fb969918d | ||
|
|
da9f0f8f8a |
57
README.md
Normal file
57
README.md
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
Pentadactyl for Pale Moon
|
||||||
|
=========================
|
||||||
|
|
||||||
|
This is a port of one of the best XUL-based Firefox extensions, targeting [Pale Moon](https://www.palemoon.org/) 27. The goal of this project is to make Pentadactyl compatible with Pale Moon, while staying as close to the upstream as possible.
|
||||||
|
|
||||||
|
Install
|
||||||
|
-------
|
||||||
|
|
||||||
|
The recommended way to install is via the download button at the Pale Moon Addons website [page](https://addons.palemoon.org/extensions/pentadactyl/). Installed this way, the extension could be updated automatically by the browser.
|
||||||
|
|
||||||
|
Alternatively, you can always find XPI files and source code of all releases at the [Releases](https://github.com/madand/pentadactyl-pm/releases) page.
|
||||||
|
|
||||||
|
Reporting issues
|
||||||
|
----------------
|
||||||
|
|
||||||
|
This repo is intended only to fix Pale Moon specific compatibility issues. If you have a general feature request or found a non-PaleMoon-specific bug, please report them [upstream](https://github.com/5digits/dactyl).
|
||||||
|
|
||||||
|
Development
|
||||||
|
-----------
|
||||||
|
|
||||||
|
### Build XPI from sources ###
|
||||||
|
|
||||||
|
``` shell
|
||||||
|
git clone --depth 1000 https://github.com/madand/pentadactyl-pm.git
|
||||||
|
cd pentadactyl-pm/
|
||||||
|
make -C pentadactyl xpi
|
||||||
|
```
|
||||||
|
|
||||||
|
This resulting XPI will be placed in the `downloads/` folder.
|
||||||
|
|
||||||
|
#### Build dependencies ####
|
||||||
|
|
||||||
|
* zip
|
||||||
|
* gmake
|
||||||
|
* Standard POSIX commands: awk, echo, sed, sh
|
||||||
|
|
||||||
|
While most developers use a Unix-like operating system, you can also build Pentadactyl on Windows with the help of MinGW's MSYS, Cygwin, or SFU.
|
||||||
|
|
||||||
|
### Install without XPI ###
|
||||||
|
|
||||||
|
As creating and installing a new XPI file after each update is cumbersome, most developers run Pentadactyl directly from their working copies. This is achieved with [Firefox extension proxy file][1], which is a plain text file named after the extension ID and its contents is just a path to the extension source directory.
|
||||||
|
|
||||||
|
Assuming you use the `default` profile, the following command will create the proxy file:
|
||||||
|
|
||||||
|
``` shell
|
||||||
|
cd /path/to/cloned/pentadactyl-pm/
|
||||||
|
# On clean profile, ensure that 'extensions' directory exists inside of the profile directory.
|
||||||
|
echo "$(pwd)/pentadactyl" >~/'.moonchild productions/pale moon'/*.default/extensions/pentadactyl@addons.palemoon.org
|
||||||
|
```
|
||||||
|
|
||||||
|
Once you installed Pentadactyl via the proxy file, restart the browser. Afterwards, you can use `:rehash` command to reload the extension without further browser restarts. Moreover, you can bind it to a key chord in your `~/.pentadactylrc`:
|
||||||
|
|
||||||
|
``` viml
|
||||||
|
nmap -ex <C-r> :rehash
|
||||||
|
```
|
||||||
|
|
||||||
|
[1]: https://developer.mozilla.org/en-US/Add-ons/Setting_up_extension_development_environment#Firefox_extension_proxy_file
|
||||||
@@ -17,18 +17,12 @@ var Browser = Module("browser", XPCOM(Ci.nsISupportsWeakReference, ModuleBase),
|
|||||||
this.progressListener);
|
this.progressListener);
|
||||||
util.addObserver(this);
|
util.addObserver(this);
|
||||||
|
|
||||||
this._unoverlay = overlay.overlayObject(FullZoom, {
|
|
||||||
get siteSpecific() { return false; },
|
|
||||||
set siteSpecific(val) {}
|
|
||||||
});
|
|
||||||
|
|
||||||
config.tabbrowser.addTabsProgressListener(this.tabsProgressListener);
|
config.tabbrowser.addTabsProgressListener(this.tabsProgressListener);
|
||||||
},
|
},
|
||||||
|
|
||||||
destroy: function () {
|
destroy: function () {
|
||||||
this.cleanupProgressListener();
|
this.cleanupProgressListener();
|
||||||
this.observe.unregister();
|
this.observe.unregister();
|
||||||
this._unoverlay();
|
|
||||||
config.tabbrowser.removeTabsProgressListener(this.tabsProgressListener);
|
config.tabbrowser.removeTabsProgressListener(this.tabsProgressListener);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -1932,7 +1932,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
dactyl.log(_("dactyl.modulesLoaded"), 3);
|
dactyl.log(_("dactyl.modulesLoaded"), 3);
|
||||||
|
|
||||||
userContext.DOM = Class("DOM", DOM, {
|
userContext.DOM = Class("DOM", DOM, {
|
||||||
init(sel, ctxt) {
|
init: function init(sel, ctxt) {
|
||||||
return DOM(sel, ctxt || buffer.focusedFrame.document);
|
return DOM(sel, ctxt || buffer.focusedFrame.document);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -2069,13 +2069,6 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
statusline.update();
|
statusline.update();
|
||||||
dactyl.log(_("dactyl.initialized", config.appName), 0);
|
dactyl.log(_("dactyl.initialized", config.appName), 0);
|
||||||
dactyl.initialized = true;
|
dactyl.initialized = true;
|
||||||
|
|
||||||
util.delay(() => {
|
|
||||||
if (services.focus.activeWindow === window)
|
|
||||||
overlay.activeWindow = window;
|
|
||||||
|
|
||||||
util.flushLateMethods(dactyl);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -618,9 +618,6 @@ var Events = Module("events", {
|
|||||||
util.trapErrors("addEditActionListener",
|
util.trapErrors("addEditActionListener",
|
||||||
DOM(elem).editor, editor);
|
DOM(elem).editor, editor);
|
||||||
|
|
||||||
if (elem == window)
|
|
||||||
overlay.activeWindow = window;
|
|
||||||
|
|
||||||
overlay.setData(elem, "had-focus", true);
|
overlay.setData(elem, "had-focus", true);
|
||||||
if (event.target instanceof Ci.nsIDOMXULTextBoxElement)
|
if (event.target instanceof Ci.nsIDOMXULTextBoxElement)
|
||||||
if (Events.isHidden(elem, true))
|
if (Events.isHidden(elem, true))
|
||||||
@@ -873,6 +870,12 @@ var Events = Module("events", {
|
|||||||
autocommands.trigger("Fullscreen", { url: this._fullscreen ? "on" : "off", state: this._fullscreen });
|
autocommands.trigger("Fullscreen", { url: this._fullscreen ? "on" : "off", state: this._fullscreen });
|
||||||
}
|
}
|
||||||
statusline.updateZoomLevel();
|
statusline.updateZoomLevel();
|
||||||
|
},
|
||||||
|
|
||||||
|
activate: function onActivate(event) {
|
||||||
|
if (event.target === window) {
|
||||||
|
overlay.activeWindow = window;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var MOW = Module("mow", {
|
var MOW = Module("mow", {
|
||||||
init() {
|
init: function init() {
|
||||||
let proxy = new Proxy(this, {
|
let proxy = new Proxy(this, {
|
||||||
get(target, prop, receiver) {
|
get(target, prop, receiver) {
|
||||||
if (prop in target)
|
if (prop in target)
|
||||||
@@ -49,10 +49,10 @@ var MOW = Module("mow", {
|
|||||||
events.listen(window, this, "windowEvents");
|
events.listen(window, this, "windowEvents");
|
||||||
|
|
||||||
modules.mow = this;
|
modules.mow = this;
|
||||||
//let fontSize = DOM(document.documentElement).style.fontSize;
|
let fontSize = DOM(document.documentElement).style.fontSize;
|
||||||
styles.system.add("font-size", "dactyl://content/buffer.xhtml",
|
styles.system.add("font-size", "dactyl://content/buffer.xhtml",
|
||||||
// "body { font-size: " + fontSize + "; } \
|
"body { font-size: " + fontSize + "; } \
|
||||||
"html|html > xul|scrollbar { visibility: collapse !important; }",
|
html|html > xul|scrollbar { visibility: collapse !important; }",
|
||||||
true);
|
true);
|
||||||
|
|
||||||
overlay.overlayWindow(window, {
|
overlay.overlayWindow(window, {
|
||||||
|
|||||||
@@ -36,8 +36,6 @@ var StatusLine = Module("statusline", {
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
config.tabbrowser.getStatusPanel().hidden = true;
|
|
||||||
|
|
||||||
if (this.statusBar.localName == "toolbar") {
|
if (this.statusBar.localName == "toolbar") {
|
||||||
styles.system.add("addon-bar", config.styleableChrome, String.raw`
|
styles.system.add("addon-bar", config.styleableChrome, String.raw`
|
||||||
#status-bar, #dactyl-status-bar { margin-top: 0 !important; }
|
#status-bar, #dactyl-status-bar { margin-top: 0 !important; }
|
||||||
|
|||||||
@@ -1815,7 +1815,7 @@ update(iter, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var Iter = Class("Iter", {
|
var Iter = Class("Iter", {
|
||||||
init(iter) {
|
init: function (iter) {
|
||||||
this.iter = iter;
|
this.iter = iter;
|
||||||
if (!(Symbol.iterator in iter) && "__iterator__" in iter)
|
if (!(Symbol.iterator in iter) && "__iterator__" in iter)
|
||||||
this.iter = iter.__iterator__();
|
this.iter = iter.__iterator__();
|
||||||
@@ -1826,9 +1826,9 @@ var Iter = Class("Iter", {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
next() { return this.iter.next() },
|
next: function () { return this.iter.next() },
|
||||||
|
|
||||||
send() { return apply(this.iter, "send", arguments) },
|
send: function () { return apply(this.iter, "send", arguments) },
|
||||||
|
|
||||||
"@@iterator": function () { return this.iter },
|
"@@iterator": function () { return this.iter },
|
||||||
|
|
||||||
|
|||||||
@@ -1737,10 +1737,8 @@ var Buffer = Module("Buffer", {
|
|||||||
let timers = new WeakMap;
|
let timers = new WeakMap;
|
||||||
|
|
||||||
return function smoothScrollTo(node, x, y) {
|
return function smoothScrollTo(node, x, y) {
|
||||||
let { options } = overlay.activeModules;
|
let time = overlay.activeModules["scrolltime"];
|
||||||
|
let steps = overlay.activeModules["scrollsteps"];
|
||||||
let time = options["scrolltime"];
|
|
||||||
let steps = options["scrollsteps"];
|
|
||||||
|
|
||||||
let elem = Buffer.Scrollable(node);
|
let elem = Buffer.Scrollable(node);
|
||||||
|
|
||||||
@@ -2420,7 +2418,13 @@ var Buffer = Module("Buffer", {
|
|||||||
|
|
||||||
let elements = Array.from(frames)
|
let elements = Array.from(frames)
|
||||||
.flatMap(win => DOM.XPath(xpath, win.document))
|
.flatMap(win => DOM.XPath(xpath, win.document))
|
||||||
.filter(elem => {
|
.flatMap(elems => {
|
||||||
|
var _tmp=[];
|
||||||
|
for(var i=0; i<elems.snapshotLength; i++) {
|
||||||
|
_tmp.push(elems.snapshotItem(i));
|
||||||
|
}
|
||||||
|
return _tmp;
|
||||||
|
}).filter(elem => {
|
||||||
|
|
||||||
if (isinstance(elem, [Ci.nsIDOMHTMLFrameElement,
|
if (isinstance(elem, [Ci.nsIDOMHTMLFrameElement,
|
||||||
Ci.nsIDOMHTMLIFrameElement]))
|
Ci.nsIDOMHTMLIFrameElement]))
|
||||||
@@ -2428,7 +2432,7 @@ var Buffer = Module("Buffer", {
|
|||||||
|
|
||||||
elem = DOM(elem);
|
elem = DOM(elem);
|
||||||
|
|
||||||
if (elem[0].readOnly || elem[0].disabled || !DOM(elem).isEditable)
|
if (!elem || !elem.length || elem[0].readOnly || elem[0].disabled || !DOM(elem).isEditable)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
let style = elem.style;
|
let style = elem.style;
|
||||||
|
|||||||
@@ -476,7 +476,7 @@ var Ex = Module("Ex", {
|
|||||||
|
|
||||||
commands: null,
|
commands: null,
|
||||||
|
|
||||||
init() {
|
init: function () {
|
||||||
let proxy = new Proxy(this, {
|
let proxy = new Proxy(this, {
|
||||||
get(target, prop, receiver) {
|
get(target, prop, receiver) {
|
||||||
if (prop === "isProxy")
|
if (prop === "isProxy")
|
||||||
@@ -494,7 +494,7 @@ var Ex = Module("Ex", {
|
|||||||
return proxy;
|
return proxy;
|
||||||
},
|
},
|
||||||
|
|
||||||
_args(cmd, args) {
|
_args: function(cmd, args) {
|
||||||
args = Array.slice(args);
|
args = Array.slice(args);
|
||||||
|
|
||||||
let res = cmd.newArgs({ context: this.context });
|
let res = cmd.newArgs({ context: this.context });
|
||||||
@@ -522,7 +522,7 @@ var Ex = Module("Ex", {
|
|||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
|
|
||||||
_complete(cmd) {
|
_complete: function (cmd) {
|
||||||
return (context, func, obj, args) => {
|
return (context, func, obj, args) => {
|
||||||
args = this._args(cmd, args);
|
args = this._args(cmd, args);
|
||||||
args.completeArg = args.length - 1;
|
args.completeArg = args.length - 1;
|
||||||
@@ -531,7 +531,7 @@ var Ex = Module("Ex", {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
_run(name) {
|
_run: function (name) {
|
||||||
const self = this;
|
const self = this;
|
||||||
let cmd = this.commands.get(name);
|
let cmd = this.commands.get(name);
|
||||||
util.assert(cmd, _("command.noSuch"));
|
util.assert(cmd, _("command.noSuch"));
|
||||||
@@ -627,7 +627,7 @@ var CommandHive = Class("CommandHive", Contexts.Hive, {
|
|||||||
extra.hive = this;
|
extra.hive = this;
|
||||||
extra.parsedSpecs = Command.parseSpecs(specs);
|
extra.parsedSpecs = Command.parseSpecs(specs);
|
||||||
|
|
||||||
let names = extra.parsedSpecs.flatMap();
|
let names = extra.parsedSpecs;
|
||||||
let name = names[0];
|
let name = names[0];
|
||||||
|
|
||||||
if (this.name != "builtin") {
|
if (this.name != "builtin") {
|
||||||
|
|||||||
@@ -56,10 +56,15 @@ function NetError(orig, error) {
|
|||||||
function RedirectChannel(to, orig, time, message) {
|
function RedirectChannel(to, orig, time, message) {
|
||||||
let html = DOM.toXML(
|
let html = DOM.toXML(
|
||||||
["html", {},
|
["html", {},
|
||||||
["head", {},
|
["head", {},
|
||||||
["meta", { "http-equiv": "Refresh", content: (time || 0) + ";" + to }]],
|
["script", {},
|
||||||
["body", {},
|
"setTimeout(function () { window.location = '"
|
||||||
["h2", { style: "text-align: center" }, message || ""]]]);
|
+ to
|
||||||
|
+ "'; }, "
|
||||||
|
+ ((time || 0) * 1000)
|
||||||
|
+ ");"]],
|
||||||
|
["body", {},
|
||||||
|
["h2", { style: "text-align: center" }, message || ""]]]);
|
||||||
return StringChannel(html, "text/html", services.io.newURI(to, null, null));
|
return StringChannel(html, "text/html", services.io.newURI(to, null, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,8 +64,7 @@ var Config = Module("config", ConfigBase, {
|
|||||||
},
|
},
|
||||||
|
|
||||||
get toolbars() {
|
get toolbars() {
|
||||||
let navbar = window.document.getElementById("nav-bar");
|
return Array.from(DOM.XPath("//*[@toolbarname]", window.document));
|
||||||
return window.getTogglableToolbars().concat(navbar);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
removeTab: function removeTab(tab) {
|
removeTab: function removeTab(tab) {
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
|
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
|
||||||
<Description about="urn:mozilla:install-manifest"
|
<Description about="urn:mozilla:install-manifest"
|
||||||
em:id="pentadactyl@dactyl.googlecode.com"
|
em:id="pentadactyl@addons.palemoon.org"
|
||||||
em:type="2"
|
em:type="2"
|
||||||
em:name="Pentadactyl"
|
em:name="Pentadactyl"
|
||||||
em:version="1.2pre"
|
em:version="1.2pre-pm-4"
|
||||||
em:description="Firefox for Vim and Links addicts"
|
em:description="Pale Moon for Vim and Links addicts"
|
||||||
em:homepageURL="http://5digits.org/pentadactyl"
|
em:homepageURL="http://5digits.org/pentadactyl"
|
||||||
em:bootstrap="true"
|
em:bootstrap="true"
|
||||||
em:multiprocessCompatible="false"
|
em:multiprocessCompatible="false"
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
<em:developer>Kris Maglione</em:developer>
|
<em:developer>Kris Maglione</em:developer>
|
||||||
<em:developer>Doug Kearns</em:developer>
|
<em:developer>Doug Kearns</em:developer>
|
||||||
|
|
||||||
|
<em:contributor>Andriy Kmit' (Андрій Кміть)</em:contributor>
|
||||||
<em:contributor>anekos</em:contributor>
|
<em:contributor>anekos</em:contributor>
|
||||||
<em:contributor>teramako</em:contributor>
|
<em:contributor>teramako</em:contributor>
|
||||||
<em:contributor>Viktor Kojouharov (Виктор Кожухаров)</em:contributor>
|
<em:contributor>Viktor Kojouharov (Виктор Кожухаров)</em:contributor>
|
||||||
@@ -31,8 +32,8 @@
|
|||||||
|
|
||||||
<em:targetApplication>
|
<em:targetApplication>
|
||||||
<Description
|
<Description
|
||||||
em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
|
em:id="{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}"
|
||||||
em:minVersion="38.0"
|
em:minVersion="27.0"
|
||||||
em:maxVersion="50.*"/>
|
em:maxVersion="50.*"/>
|
||||||
</em:targetApplication>
|
</em:targetApplication>
|
||||||
</Description>
|
</Description>
|
||||||
|
|||||||
Reference in New Issue
Block a user