cүвεя_נυηкιε 68 Posted July 20, 2016 Report Share Posted July 20, 2016 Hey there, Wondering if anyone can give me a friendly pointer, Is there a way to disable the default context menu on right click within either UBot itself, a compiled bot ... or both (within a Load HTML) ? Im currently working a project that requires a custom context menu when the user clicks their right mouse button, The menu is coded with javascript and works perfectly in every environment ive tested in ... (multiple browsers, DW, JSfiddle etc etc etc etc ...)but cant test it in UBot during development or a compiled bot simply because i cant seem to get the default context menu to go away lol Ive tried the same code in a UI HTML Window but always the same default menu. I figured that the datagrid plugin here has that function so there must be a way to do it ...... right ? Ive already searched around the forum,but ill pop off and have another scour just in case i missed something Thanks in advanceCJ Quote Link to post Share on other sites
deliter 203 Posted July 20, 2016 Report Share Posted July 20, 2016 I tried before too and gave UPI think when testing the right click doesn't fire correctly,in js you can see type of click made,say a right click is 2,it was firing 1,so your code is never actually initialized Quote Link to post Share on other sites
cүвεя_נυηкιε 68 Posted July 20, 2016 Author Report Share Posted July 20, 2016 I tried before too and gave UPI think when testing the right click doesn't fire correctly,in js you can see type of click made,say a right click is 2,it was firing 1,so your code is never actually initialized Ahhhhh, .. dont say that !! .. lmao Thanks for the reply deliter even if it was a blow somewhat below the belt, .. ill keep looking anyway, if I am anything its persistent ... possibly even obsessive when it comes to problem solving haha CheersCJ Quote Link to post Share on other sites
deliter 203 Posted July 20, 2016 Report Share Posted July 20, 2016 Sucks I am following the thread if you are sucessful please report back,you will need to find a way of recognising the click with an unconventional method,check out this code,works fine in Chrome/Firefox,in Ubot with load HTML quite different <head> </head> <body > <p id="results"></p> <script> document.addEventListener("mousedown",function(e){ switch(e.buttons) { case 1: document.getElementById("results").textContent = "You pressed Left Mouse" break; case 2: document.getElementById("results").textContent = "You pressed Right Mouse" break; case 3: document.getElementById("results").textContent = "You pressed Middle Mouse" break; default: document.getElementById("results").textContent = "You Shouldnt be Seeing This Message!!" } }) </script> </body> 1 Quote Link to post Share on other sites
cүвεя_נυηкιε 68 Posted July 22, 2016 Author Report Share Posted July 22, 2016 Sucks I am following the thread if you are sucessful please report back,you will need to find a way of recognising the click with an unconventional method,check out this code,works fine in Chrome/Firefox,in Ubot with load HTML quite different <head> </head> <body > <p id="results"></p> <script> document.addEventListener("mousedown",function(e){ switch(e.buttons) { case 1: document.getElementById("results").textContent = "You pressed Left Mouse" break; case 2: document.getElementById("results").textContent = "You pressed Right Mouse" break; case 3: document.getElementById("results").textContent = "You pressed Middle Mouse" break; default: document.getElementById("results").textContent = "You Shouldnt be Seeing This Message!!" } }) </script> </body> Hey, Thanks for the extra info, appreciated Ok, .. ....... Well, ........ .. who would have thought something as simple as disabling a context menu would lead down such a dark road of nothing but mystery and misery Not only am i biblically staggered that is really only 3 or 4 ways of actually doing this in a "normal" browser but im still a little confused with exactly how UBot itself deals with ANY javascript that has anything to do with the right mouse button A bit disappointed if im honest and I might even shoot a quick message to Seth or indeed anyone from UBot staff to see if there is a workaround or any plans to add this sort of ability in an update, My plan was to come back here and list all the methods ive tried to perhaps leave a breadcrumb trail for anyone looking to do the same or research but without any control over the right mouse button it seems fairly pointless, one theory i had was to make the bot think that the right mouse button was the left and therefore eliminating the need to control the right click,but after poking around for a couple of days found that it just created more bugs and weird behaviour, .. so I modified the javascript just a little to make the context menu show on both left and right click just in case something comes up in the future, and for now using the left button will have to do , ..not ideal but this way all that is needed is an extra function to be fired off after a context item has been selected to close the menu again and of course I get to keep the context menu that I built I cant get out of my head that the Datagrid plugin here does exactly what is required here and right click context menus are indeed possible, but anyone who has used that plugin will know that you need to switch OUT of browser mode for it to work, so that must mean that the cause lies solely with the UBot browser, I think i might pop over to that plugin page and ask some Q's .... Is it me or is not knowing something that sounds so simple properly annoying haha LMAO If i come across anything else ill be back CheersCJ Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.