1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-17 17:55:46 +01:00

11 Commits

Author SHA1 Message Date
d4b7e64470 Ported fixes for PM-28.6
Ported fixes from
https://github.com/RFDAJE/pentadactyl/tree/fix-palemoon-28.6
2019-07-08 18:26:34 +02:00
Jack Rosenthal
0a05e0089b protocol: make RedirectChannel compatible with PM 28.5
The sketchy meta-redirect previously used was no longer working with
Palemoon 28.5. This is an even more sketchy version that uses a
JavaScript redirect, but seems to work.

This redirect screws up the history, so this introduces a new bug as
well :/

My XPCOM-fu isn't quite good enough to figure out a nice way to
redirect a channel without this crap, so open to suggestions on a more
elegant way to solve this.

BUG=madand#9
TEST=visited dactyl://help-tag/starting and got to the correct page

Signed-off-by: Jack Rosenthal <jack@rosenth.al>
2019-05-12 08:38:16 -06:00
Jack Rosenthal
00536f5feb Palemoon 28.5 compatibility
This is a patch for compatibility with PM 28.5 based on Billylll@'s
patch posted to madand#7.
2019-05-05 15:40:19 -06:00
MadAnd
4b81d89a3e Add notice about reporting issues 2017-07-06 15:09:17 +03:00
MadAnd
9069da69e6 Re-apply "Explicitly disable multiprocess Firefox"
9584f6d1be
2017-01-26 21:23:46 +02:00
MadAnd
834077f282 Add link to page at Pale Moon Addons 2017-01-23 04:40:53 +02:00
MadAnd
864482cd7b Release 1.2pre-pm-3 2017-01-23 04:13:03 +02:00
Zheng Chaoping
0a46c4be52 Cherry pick 5digits/dactyl#178
Fix `TypeError: options is undefined`

When open a new window and close it, then press `gg` in the original window
will throw `TypeError: options is undefined`.
2017-01-23 04:10:23 +02:00
MadAnd
1910720de8 Release 1.2pre-pm-2 2017-01-21 19:21:27 +02:00
MadAnd
44563c4a85 Change application GUID to Pale Moon's one 2017-01-21 19:09:25 +02:00
MadAnd
7f44847ee3 Add readme 2017-01-21 06:51:19 +02:00
9 changed files with 95 additions and 32 deletions

57
README.md Normal file
View 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

View File

@@ -1932,7 +1932,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
dactyl.log(_("dactyl.modulesLoaded"), 3);
userContext.DOM = Class("DOM", DOM, {
init(sel, ctxt) {
init: function init(sel, ctxt) {
return DOM(sel, ctxt || buffer.focusedFrame.document);
}
});
@@ -2069,13 +2069,6 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
statusline.update();
dactyl.log(_("dactyl.initialized", config.appName), 0);
dactyl.initialized = true;
util.delay(() => {
if (services.focus.activeWindow === window)
overlay.activeWindow = window;
util.flushLateMethods(dactyl);
});
}
});

View File

@@ -618,9 +618,6 @@ var Events = Module("events", {
util.trapErrors("addEditActionListener",
DOM(elem).editor, editor);
if (elem == window)
overlay.activeWindow = window;
overlay.setData(elem, "had-focus", true);
if (event.target instanceof Ci.nsIDOMXULTextBoxElement)
if (Events.isHidden(elem, true))
@@ -873,6 +870,12 @@ var Events = Module("events", {
autocommands.trigger("Fullscreen", { url: this._fullscreen ? "on" : "off", state: this._fullscreen });
}
statusline.updateZoomLevel();
},
activate: function onActivate(event) {
if (event.target === window) {
overlay.activeWindow = window;
}
}
},

View File

@@ -7,7 +7,7 @@
"use strict";
var MOW = Module("mow", {
init() {
init: function init() {
let proxy = new Proxy(this, {
get(target, prop, receiver) {
if (prop in target)

View File

@@ -1815,7 +1815,7 @@ update(iter, {
});
var Iter = Class("Iter", {
init(iter) {
init: function (iter) {
this.iter = iter;
if (!(Symbol.iterator in iter) && "__iterator__" in iter)
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 },

View File

@@ -1737,10 +1737,8 @@ var Buffer = Module("Buffer", {
let timers = new WeakMap;
return function smoothScrollTo(node, x, y) {
let { options } = overlay.activeModules;
let time = options["scrolltime"];
let steps = options["scrollsteps"];
let time = overlay.activeModules["scrolltime"];
let steps = overlay.activeModules["scrollsteps"];
let elem = Buffer.Scrollable(node);
@@ -2420,7 +2418,13 @@ var Buffer = Module("Buffer", {
let elements = Array.from(frames)
.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,
Ci.nsIDOMHTMLIFrameElement]))
@@ -2428,7 +2432,7 @@ var Buffer = Module("Buffer", {
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;
let style = elem.style;

View File

@@ -476,7 +476,7 @@ var Ex = Module("Ex", {
commands: null,
init() {
init: function () {
let proxy = new Proxy(this, {
get(target, prop, receiver) {
if (prop === "isProxy")
@@ -494,7 +494,7 @@ var Ex = Module("Ex", {
return proxy;
},
_args(cmd, args) {
_args: function(cmd, args) {
args = Array.slice(args);
let res = cmd.newArgs({ context: this.context });
@@ -522,7 +522,7 @@ var Ex = Module("Ex", {
return res;
},
_complete(cmd) {
_complete: function (cmd) {
return (context, func, obj, args) => {
args = this._args(cmd, args);
args.completeArg = args.length - 1;
@@ -531,7 +531,7 @@ var Ex = Module("Ex", {
};
},
_run(name) {
_run: function (name) {
const self = this;
let cmd = this.commands.get(name);
util.assert(cmd, _("command.noSuch"));
@@ -627,7 +627,7 @@ var CommandHive = Class("CommandHive", Contexts.Hive, {
extra.hive = this;
extra.parsedSpecs = Command.parseSpecs(specs);
let names = extra.parsedSpecs.flatMap();
let names = extra.parsedSpecs;
let name = names[0];
if (this.name != "builtin") {

View File

@@ -56,10 +56,15 @@ function NetError(orig, error) {
function RedirectChannel(to, orig, time, message) {
let html = DOM.toXML(
["html", {},
["head", {},
["meta", { "http-equiv": "Refresh", content: (time || 0) + ";" + to }]],
["body", {},
["h2", { style: "text-align: center" }, message || ""]]]);
["head", {},
["script", {},
"setTimeout(function () { window.location = '"
+ to
+ "'; }, "
+ ((time || 0) * 1000)
+ ");"]],
["body", {},
["h2", { style: "text-align: center" }, message || ""]]]);
return StringChannel(html, "text/html", services.io.newURI(to, null, null));
}

View File

@@ -5,10 +5,11 @@
em:id="pentadactyl@addons.palemoon.org"
em:type="2"
em:name="Pentadactyl"
em:version="1.2pre-pm-1"
em:version="1.2pre-pm-4"
em:description="Pale Moon for Vim and Links addicts"
em:homepageURL="http://5digits.org/pentadactyl"
em:bootstrap="true"
em:multiprocessCompatible="false"
em:strictCompatibility="true">
<em:creator>Kris Maglione, Doug Kearns</em:creator>
@@ -31,7 +32,7 @@
<em:targetApplication>
<Description
em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
em:id="{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}"
em:minVersion="27.0"
em:maxVersion="50.*"/>
</em:targetApplication>