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

0 favourites
From the Asset Store
Make your craft game come to life with this sounds :D
  • Glad to see there is a way to prevent it! However, I'm stuck here:

    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?

  • 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?

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

  • 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

  • That's only for the button objects, the problem occurs when middle clicking on everything, even on the background

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

    "$(function(){$('body').mousedown(function(e){if(e.button==1)return false});});"[/code:5jm700ve]
  • So you kinda have scrollable game I guess, well try the code from below just execute it in the way you already know.

    "$(function(){$('body').mousedown(function(e){if(e.button==1)return false});});"[/code:15fz32i3]
    

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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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?

  • > 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

    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

    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

  • ...

    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.

  • 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; }

  • 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?

  • > 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?

    They do

    The new code works fine for MMB, i just need to assign a form ID to buttons as well (unless there is another "body" for them too)

  • The new code works fine for MMB, i just need to assign a form ID to buttons as well (unless there is another "body" for them too)

    Could you precisely explain your problem based on "what you want to achieve" and "what the problems are", sorry but I'm a little confused right now.

  • Could you precisely explain your problem based on "what you want to achieve" and "what the problems are", sorry but I'm a little confused right now.

    The previous problem was the scrolling icon appearing when clicking middle mouse.

    The code you gave me disabled completely middle mouse interactions, so it solved the problem but prevented the game from using the MMB.

    So i found a new code that works just fine (disables the scrolling icon, but allows to use MMB on objects).

    this one: "document.body.onmousedown = function(e) { if (e.button === 1) return false; }"

    Now, the only issue is not really a big deal, i just need to know if there is a "global" form/ID for button objects as well (like "body" for other objects), so i dont need to assign a formID to all the 100+ buttons in my projects

  • Now, the only issue is not really a big deal, i just need to know if there is a "global" form/ID for button objects as well (like "body" for other objects", so i dont need to assign a formID to all the 100+ buttons in my projects

    Armaldio gave me this code, try this one out please:

    "$(function(){$(document.body).mousedown(function(e){if(e.button==1)return false});});"[/code:2ubgxa1g]
    [b][u]
    EDIT:[/u][/b] In the worst case you could create families for the form elements and assign them an ID.
  • > Now, the only issue is not really a big deal, i just need to know if there is a "global" form/ID for button objects as well (like "body" for other objects", so i dont need to assign a formID to all the 100+ buttons in my projects

    >

    Armaldio gave me this code, try this one out please:

    "$(function(){$(document.body).mousedown(function(e){if(e.button==1)return false});});"[/code:2997l2jh]
    [b][u]
    EDIT:[/u][/b] In the worst case you could create families for the form elements and assign them an ID.
    

    The code is just like the one i found, works fine for "body". So i can assign form ID to whole button family? Because i can't find the form proprieties of the button family in the editor

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)