I cannot check 258 older pages!!!nohamelin wrote:@firefoxuse
They are a bunch of code requests, without providing a single clue if you at least took some time to check older pages in this thread to find something similar. The bigger the request, the greater the patience you need to wait for someone who can take that task for you.
keyconfig 20110522
-
- Posts: 1086
- Joined: November 8th, 2011, 12:06 pm
Re: keyconfig 20110522
- malliz
- Folder@Home
- Posts: 43796
- Joined: December 7th, 2002, 4:34 am
- Location: Australia
Re: keyconfig 20110522
Tried the search this topic box?
What sort of man would put a known criminal in charge of a major branch of government? Apart from, say, the average voter.
"Terry Pratchett"
"Terry Pratchett"
-
- Posts: 1086
- Joined: November 8th, 2011, 12:06 pm
Re: keyconfig 20110522
yes it didn't workmalliz wrote:Tried the search this topic box?
there should be a list with the common functions, the developer should consider that
- malliz
- Folder@Home
- Posts: 43796
- Joined: December 7th, 2002, 4:34 am
- Location: Australia
Re: keyconfig 20110522
What sort of man would put a known criminal in charge of a major branch of government? Apart from, say, the average voter.
"Terry Pratchett"
"Terry Pratchett"
-
- Posts: 1086
- Joined: November 8th, 2011, 12:06 pm
Re: keyconfig 20110522
well that seems to help, but only a bitmalliz wrote:http://mozilla.dorando.at/keyconfig/examples.html
I don't know what coding language is that and if there is a reference so that I can script my own commands!
-
- New Member
- Posts: 1
- Joined: April 16th, 2017, 12:26 pm
Re: keyconfig 20110522
Hi i am getting stuck in writing a script that should forward a selected email inline with attachments to a dedicated recipient defined in the script.
The email should not be send automaticially, but i want to add a predefined text "Hello, please check this email" by the script and manually press the "send" button.
Any ideas how to to this?
best reagrds alex
The email should not be send automaticially, but i want to add a predefined text "Hello, please check this email" by the script and manually press the "send" button.
Any ideas how to to this?
best reagrds alex
-
- Posts: 6421
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
@deltaa
Try this:
Similar post: http://forums.mozillazine.org/viewtopic ... #p14725693
Try this:
Code: Select all
// forward inline, add recipient, insert text
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].
getService(Components.interfaces.nsIWindowMediator);
var msgHdr = gFolderDisplay.selectedMessage;
var listener = {
onWindowTitleChange: function () {},
onCloseWindow: function () {},
onOpenWindow: function (aWindow) {
wm.removeListener(this);
this.compose = aWindow.docShell.
QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindow);
this.compose.addEventListener("compose-window-init", this, true);
},
handleEvent: function (event) {
event.currentTarget.removeEventListener(event.type, this, true);
event.currentTarget.gMsgCompose.RegisterStateListener(listener);
},
NotifyComposeFieldsReady: function () {},
NotifyComposeBodyReady: function () {
this.compose.gMsgCompose.UnregisterStateListener(this);
this.compose.window.setTimeout(function () {
this.AddRecipient("addr_to", "foo bar <test@invalid.com>");
this.awDeleteRow(this.awGetMaxRecipients());
this.GetCurrentEditor().insertText("Abracadabra.");
}, 0);
}
}
wm.addListener(listener);
MsgForwardAsInline(null);
-
- Posts: 1
- Joined: April 13th, 2017, 7:07 pm
Re: keyconfig 20110522
// forward inline, add recipient, insert text
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].
getService(Components.interfaces.nsIWindowMediator);
var msgHdr = gFolderDisplay.selectedMessage;
var listener = {
onWindowTitleChange: function () {},
onCloseWindow: function () {},
onOpenWindow: function (aWindow) {
wm.removeListener(this);
this.compose = aWindow.docShell.
QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindow);
this.compose.addEventListener("compose-window-init", this, true);
},
handleEvent: function (event) {
event.currentTarget.removeEventListener(event.type, this, true);
event.currentTarget.gMsgCompose.RegisterStateListener(listener);
},
NotifyComposeFieldsReady: function () {},
NotifyComposeBodyReady: function () {
this.compose.gMsgCompose.UnregisterStateListener(this);
this.compose.window.setTimeout(function () {
this.AddRecipient("addr_to", "foo bar <test@invalid.com>");
this.awDeleteRow(this.awGetMaxRecipients());
this.GetCurrentEditor().insertText("Abracadabra.");
}, 0);
}
}
wm.addListener(listener);
MsgForwardAsInline(null);
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].
getService(Components.interfaces.nsIWindowMediator);
var msgHdr = gFolderDisplay.selectedMessage;
var listener = {
onWindowTitleChange: function () {},
onCloseWindow: function () {},
onOpenWindow: function (aWindow) {
wm.removeListener(this);
this.compose = aWindow.docShell.
QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindow);
this.compose.addEventListener("compose-window-init", this, true);
},
handleEvent: function (event) {
event.currentTarget.removeEventListener(event.type, this, true);
event.currentTarget.gMsgCompose.RegisterStateListener(listener);
},
NotifyComposeFieldsReady: function () {},
NotifyComposeBodyReady: function () {
this.compose.gMsgCompose.UnregisterStateListener(this);
this.compose.window.setTimeout(function () {
this.AddRecipient("addr_to", "foo bar <test@invalid.com>");
this.awDeleteRow(this.awGetMaxRecipients());
this.GetCurrentEditor().insertText("Abracadabra.");
}, 0);
}
}
wm.addListener(listener);
MsgForwardAsInline(null);
[/u][/i][/b]Code: Select all
[list][list=][*][img][url][color=#4000FF] :D =D> ](*,) =D> [/color][/url][/img][/list][/list]
-
- Posts: 1934
- Joined: February 10th, 2008, 6:30 am
- Location: Hungary
Re: keyconfig 20110522
Hi!
Is it possible to set a shortcut to a few of DownThemAll!'s features available from the context menu?
eg: "DownThemAll!", "DownThemAll! Selection", "Save Link with DownThemAll!"
So far my attempts failed. The code which appears in DOM inspector (eg.: "dta:regular") is suspiciously nothing like code I used in keyconfig before
Is it possible to set a shortcut to a few of DownThemAll!'s features available from the context menu?
eg: "DownThemAll!", "DownThemAll! Selection", "Save Link with DownThemAll!"
So far my attempts failed. The code which appears in DOM inspector (eg.: "dta:regular") is suspiciously nothing like code I used in keyconfig before
-
- Posts: 6421
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
@avada
Try these:
Try these:
Code: Select all
// DownThemAll!
var command = document.getElementById("dta:regular");
command.doCommand();
Code: Select all
// DownThemAll! Selection
var command = document.getElementById("dta:regular-sel");
command.doCommand();
Code: Select all
// Save Link with DownThemAll!
var command = document.getElementById("dta:regular-link");
command.doCommand();
-
- Posts: 1934
- Joined: February 10th, 2008, 6:30 am
- Location: Hungary
Re: keyconfig 20110522
Thanks you very much!morat wrote:@avada
Try these:
Code: Select all
// DownThemAll! var command = document.getElementById("dta:regular"); command.doCommand();
Code: Select all
// DownThemAll! Selection var command = document.getElementById("dta:regular-sel"); command.doCommand();
Code: Select all
// Save Link with DownThemAll! var command = document.getElementById("dta:regular-link"); command.doCommand();
The first two work splendidly. The third, sadly though no unexpectedly doesn't. I get a "TypeError: window.gContextMenu is null" error in the console. (Even if I use tab to get the link selected)
So I guess there's no way of passing for example the hovered link (the way flashgot did it) to the save link feature of DTA?
-
- Posts: 6421
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
@avada
I tried using a trick based on the following code, but it no longer works. I get a "TypeError: gContextMenuContentData is null" error in the console.
I don't know how to execute the last command.
I tried using a trick based on the following code, but it no longer works. I get a "TypeError: gContextMenuContentData is null" error in the console.
Code: Select all
// fails
// view image or background image using gContextMenu
// left click image - open image in current tab
// left click image with ctrl - open image in new tab in foreground
// left click image with ctrl and shift - open image in new tab in background
// left click image with shift - open image in new window
// middle click image - same as left click with ctrl
function handleClick(event) {
window.removeEventListener("click", handleClick, true);
event.preventDefault();
event.stopPropagation();
document.popupNode = event.originalTarget;
var menuPopup = document.getElementById("contentAreaContextMenu");
var shiftKey = false;
gContextMenu = new nsContextMenu(menuPopup, shiftKey);
if (gContextMenu.onImage) gContextMenu.viewMedia(event);
else if (gContextMenu.hasBGImage) gContextMenu.viewBGImage(event);
gContextMenu = null;
}
window.addEventListener("click", handleClick, true);
Code: Select all
// fails
// Save Link with DownThemAll!
document.popupNode = document.commandDispatcher.focusedElement;
var menuPopup = document.getElementById("contentAreaContextMenu");
var shiftKey = false;
gContextMenu = new nsContextMenu(menuPopup, shiftKey);
document.getElementById("dta:regular-link").doCommand();
gContextMenu = null;
-
- Posts: 1934
- Joined: February 10th, 2008, 6:30 am
- Location: Hungary
Re: keyconfig 20110522
morat wrote: I tried using a trick based on the following code, but it no longer works. I get a "TypeError: gContextMenuContentData is null" error in the console.
Okay. Thanks for trying!morat wrote:I don't know how to execute the last command.
-
- Posts: 6421
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
@avada
You can use the NirCmd program to send a right click, then execute the command.
http://www.nirsoft.net/utils/nircmd.html
http://www.nirsoft.net/utils/nircmd2.html#sendmouse
Similar post: http://forums.mozillazine.org/viewtopic ... #p12958067
You can use the NirCmd program to send a right click, then execute the command.
Code: Select all
// Save Link with DownThemAll!
var localFile = Components.classes["@mozilla.org/file/local;1"].
createInstance(Components.interfaces.nsILocalFile);
var process = Components.classes["@mozilla.org/process/util;1"].
createInstance(Components.interfaces.nsIProcess);
var args = ["sendmouse", "right", "click"];
localFile.initWithPath("C:\\nircmd.exe");
process.init(localFile);
process.run(false, args, args.length);
setTimeout(function () {
document.getElementById("dta:regular-link").doCommand();
}, 1000);
http://www.nirsoft.net/utils/nircmd2.html#sendmouse
Similar post: http://forums.mozillazine.org/viewtopic ... #p12958067
-
- Posts: 6421
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
@avada
You can use the ctypes to send a right click, then execute the command.
Similar post: http://forums.mozillazine.org/viewtopic ... #p12970451
You can use the ctypes to send a right click, then execute the command.
Code: Select all
// Save Link with DownThemAll!
Components.utils.import("resource://gre/modules/ctypes.jsm");
var user32 = ctypes.open("user32");
var BOOL = ctypes.int;
var LONG = ctypes.long;
var POINT = ctypes.StructType("tagPOINT", [{x:LONG}, {y:LONG}]);
var LPPOINT = POINT.ptr;
var GetCursorPos = user32.declare('GetCursorPos', ctypes.winapi_abi, BOOL, LPPOINT);
var point = new POINT;
if (GetCursorPos(point.address())) {
var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindowUtils);
var MOUSEEVENTF_RIGHTDOWN = 0x0008;
var MOUSEEVENTF_RIGHTUP = 0x0010;
utils.sendNativeMouseEvent(point.x, point.y, MOUSEEVENTF_RIGHTDOWN | MOUSEEVENTF_RIGHTUP, 0, null);
}
user32.close();
setTimeout(function () {
document.getElementById("dta:regular-link").doCommand();
}, 1000);