StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Surenpahlav  
#1 Posted : Monday, July 12, 2021 5:30:41 AM(UTC)
Surenpahlav

Rank: Member

Reputation:

Groups: Approved
Joined: 3/24/2020(UTC)
Posts: 22

The code below for triggering something based on if the cursor is a "hand" doesn't work in Firefox anymore, but it still works in Chrome and Edge.


var open_link_in_background = false;
var clicked = false;

sp.ConsumePhysicalInput(true);

for(var Y = action.Start.Y; Y <= action.Start.Y + 6; Y += 2) {
sp.MouseMove(new Point(action.Start.X, Y));
sp.Sleep(20);
if(sp.GetCurrentMouseCursor() == "Hand") {
if(open_link_in_background) {
sp.MouseClick(new Point(action.Start.X, Y), MouseButtons.Middle, true, true);
} else {
sp.SendControlDown();
sp.Sleep(100);
sp.MouseClick(new Point(action.Start.X, Y), MouseButtons.Left, true, true);
sp.SendControlUp();
}
clicked = true;
break; //Stop looping
}
}

if(!clicked) {
sp.SendKeys("^l"); // Send CTRL+L keystroke
}

sp.ConsumePhysicalInput(false);
sp.MouseMove(action.End);

Rob  
#2 Posted : Monday, July 12, 2021 3:32:27 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,036
United States
Location: Tampa, FL

Thanks: 22 times
Was thanked: 308 time(s) in 269 post(s)
I just tested in Firefox 89.0.2 (64-bit) and it works fine for me.

Do you have any extensions or custom settings which may be affecting the presentation (style) of the hand/pointer cursor?
Surenpahlav  
#3 Posted : Monday, July 12, 2021 6:45:15 PM(UTC)
Surenpahlav

Rank: Member

Reputation:

Groups: Approved
Joined: 3/24/2020(UTC)
Posts: 22

Strange, I disabled all extensions, put on the default theme, removed the custom userChrome file I've made and checked all settings relevant to this; still doesn't work.

But I should say that it's not only the "hand" trigger of this code that doesn't work, I put "ctrl+L" in the code to focus the URL bar if the cursor is not on a link. So that doesn't require a hand cursor, and it doesn't work either. Anyway this started recently, not sure when.
Rob  
#4 Posted : Monday, July 12, 2021 6:52:47 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,036
United States
Location: Tampa, FL

Thanks: 22 times
Was thanked: 308 time(s) in 269 post(s)
It sounds like possibly the script isn't executing.

Do you see a message if you put this at the top of the script?
Code:
sp.MessageBox("Browser Script", "Hi");
Surenpahlav  
#5 Posted : Monday, July 12, 2021 7:01:20 PM(UTC)
Surenpahlav

Rank: Member

Reputation:

Groups: Approved
Joined: 3/24/2020(UTC)
Posts: 22

Yea.
Surenpahlav  
#6 Posted : Monday, July 12, 2021 7:03:01 PM(UTC)
Surenpahlav

Rank: Member

Reputation:

Groups: Approved
Joined: 3/24/2020(UTC)
Posts: 22

Strangely now that I've put the code above it and then deleted it the same code works...
Surenpahlav  
#7 Posted : Monday, July 12, 2021 7:05:27 PM(UTC)
Surenpahlav

Rank: Member

Reputation:

Groups: Approved
Joined: 3/24/2020(UTC)
Posts: 22

Oh... the gesture was set on the empty "steps" tab when it didn't work, when set on script tab it works... my bad.
Rob  
#8 Posted : Monday, July 12, 2021 7:26:14 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,036
United States
Location: Tampa, FL

Thanks: 22 times
Was thanked: 308 time(s) in 269 post(s)
Ah, yeah whichever tab is selected (Steps or Script) is the one that gets executed.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.