NW.js Is Vulnerable (Developer Tools Can Be Accessed!)

Bugs will be moved here once resolved.

Post » Wed Oct 26, 2016 12:22 pm

Glad to see there is a way to prevent it! However, I'm stuck here:

TheRealDannyyy wrote:4. Set an ID for the form element(s) where you want to prevent middle clicking



I didn't even know there is a way to assign an ID to whole categories of objects, how can i do it? :roll:
B
66
S
22
G
4
Posts: 360
Reputation: 6,584

Post » Wed Oct 26, 2016 12:29 pm

Danwood wrote:Glad to see there is a way to prevent it! However, I'm stuck here:
I didn't even know there is a way to assign an ID to whole categories of objects, how can i do it? :roll:

In the object propeties of the form object that you want to use.
ImageImageImage
B
63
S
23
G
78
Posts: 664
Reputation: 44,941

Post » Wed Oct 26, 2016 12:44 pm

TheRealDannyyy wrote:In the object propeties of the form object that you want to use.


That's only for the button objects, the problem occurs when middle clicking on everything, even on the background :shock:
B
66
S
22
G
4
Posts: 360
Reputation: 6,584

Post » Wed Oct 26, 2016 12:47 pm

Danwood wrote:That's only for the button objects, the problem occurs when middle clicking on everything, even on the background :shock:

So you kinda have scrollable game I guess, well try the code from below just execute it in the way you already know.

Code: Select all
"$(function(){$('body').mousedown(function(e){if(e.button==1)return false});});"
ImageImageImage
B
63
S
23
G
78
Posts: 664
Reputation: 44,941

Post » Wed Oct 26, 2016 12:53 pm

TheRealDannyyy wrote:So you kinda have scrollable game I guess, well try the code from below just execute it in the way you already know.
Code: Select all
"$(function(){$('body').mousedown(function(e){if(e.button==1)return false});});"


Yes it's something about scrolling! But the new code still doesn't work (does "body" represents all the objects?).
B
66
S
22
G
4
Posts: 360
Reputation: 6,584

Post » Wed Oct 26, 2016 12:56 pm

Danwood wrote:Yes it's something about scrolling! But the new code still doesn't work (does "body" represents all the objects?).

It should include everything exept form elements and how you block it for form elements is already mentioned above.

EDIT: You only use NWjs for this right, like I've already stated the results of these scripts may vary on other browsers?
ImageImageImage
B
63
S
23
G
78
Posts: 664
Reputation: 44,941

Post » Wed Oct 26, 2016 1:00 pm

TheRealDannyyy wrote:
Danwood wrote:Yes it's something about scrolling! But the new code still doesn't work (does "body" represents all the objects?).

It should include everything exept form elements and how you block it for form elements is already mentioned above.


Now i see it why it didn't work! I was accidentally clicking on a button :lol:

Is there also another universal form for button objects like "body"? It would save me a lot of time instead of assigning a form id to 100 buttons :P

Btw thank you so much!

EDIT: nevermind, apparently, the code disabled every use of middle mouse, i would need a way to only prevent the scroll thing to appear, not disabling MMB as a whole :roll:
B
66
S
22
G
4
Posts: 360
Reputation: 6,584

Post » Wed Oct 26, 2016 1:09 pm

Danwood wrote:...
EDIT: nevermind, apparently, the code disabled every use of middle mouse, i would need a way to only prevent the scroll thing to appear, not disabling MMB as a whole

I'm not an expert but doing that in JS sounds like a pain in the a**, I can give to over to Armaldio again but I promise you nothing.
ImageImageImage
B
63
S
23
G
78
Posts: 664
Reputation: 44,941

Post » Wed Oct 26, 2016 1:09 pm

This one works as intended, it disables the scroll icon, but retains the ability to interact with MMB

document.body.onmousedown = function(e) { if (e.button === 1) return false; }
B
66
S
22
G
4
Posts: 360
Reputation: 6,584

Post » Wed Oct 26, 2016 1:11 pm

Danwood wrote:This one works as intended, it disables the scroll icon, but retains the ability to interact with MMB
document.body.onmousedown = function(e) { if (e.button === 1) return false; }

He's on it, might take a little while seems to be busy at the moment.
By the way, what about the previous one with the rightclick context menu, do right click actions work as intended?
ImageImageImage
B
63
S
23
G
78
Posts: 664
Reputation: 44,941

PreviousNext

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest