mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 02:17:59 +01:00
Fix generating incorrect help pages on Firefox 4.
This commit is contained in:
@@ -311,7 +311,7 @@ var Buffer = Module("buffer", {
|
||||
allFrames: function allFrames(win, focusedFirst) {
|
||||
let frames = [];
|
||||
(function rec(frame) {
|
||||
if (frame.document.body instanceof HTMLBodyElement)
|
||||
if (true || frame.document.body instanceof HTMLBodyElement)
|
||||
frames.push(frame);
|
||||
Array.forEach(frame.frames, rec);
|
||||
})(win || content);
|
||||
|
||||
@@ -871,7 +871,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
value = "hl-" + value;
|
||||
}
|
||||
if (name == "href") {
|
||||
value = node.href;
|
||||
value = node.href || value;
|
||||
if (value.indexOf("dactyl://help-tag/") == 0) {
|
||||
let uri = services.io.newChannel(value, null, null).originalURI;
|
||||
value = uri.spec == value ? "javascript:;" : uri.path.substr(1);
|
||||
@@ -907,8 +907,10 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
let chromeFiles = {};
|
||||
let styles = {};
|
||||
for (let [file, ] in Iterator(services["dactyl:"].FILE_MAP)) {
|
||||
dactyl.open("dactyl://help/" + file);
|
||||
dactyl.modules.events.waitForPageLoad();
|
||||
let url = "dactyl://help/" + file;
|
||||
dactyl.open(url);
|
||||
util.waitFor(function () content.location.href == url, 5000);
|
||||
events.waitForPageLoad();
|
||||
var data = [
|
||||
'<?xml version="1.0" encoding="UTF-8"?>\n',
|
||||
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n',
|
||||
|
||||
@@ -1055,11 +1055,12 @@ var Events = Module("events", {
|
||||
if (buffer.loaded)
|
||||
return true;
|
||||
|
||||
dactyl.echo(_("macro.loadWaiting"), commandline.DISALLOW_MULTILINE);
|
||||
dactyl.echo(_("macro.loadWaiting"), commandline.FORCE_SINGLELINE);
|
||||
|
||||
const maxWaitTime = (time || 25);
|
||||
util.waitFor(function () !events.feedingKeys || buffer.loaded, this, maxWaitTime * 1000, true);
|
||||
util.waitFor(function () buffer.loaded, this, maxWaitTime * 1000, true);
|
||||
|
||||
dactyl.echo("", commandline.FORCE_SINGLELINE);
|
||||
if (!buffer.loaded)
|
||||
dactyl.echoerr(_("macro.loadFailed", maxWaitTime));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user