View Full Version : Suppress Links in Web Browser
craigedmonds
01-30-2006, 06:51 PM
My web browser is coming along nicely now.
I have licensing going on, checks for internet etc etc.
The only problem I have now are these....
1) people can right click and see the url or the page (which I dont want them to)
2) when someone does "shift + left click" on a link, a new internet explorer window open up OUTSIDE of my browser.
....is there a way in Autoplay 6, to stop people right clicking and doing the shift + left click thing?
I am using asp pages as my destination pages in my mini browser, would using .net pages help me?
I heard that in .net you can prevent people righ clicking etc.
Corey
01-30-2006, 07:29 PM
Javascript links can't be SHIFT + CLICKED. DHTML/Javascript in your HTML page is the best way to get rid of right clicking. Tons of those on Google. In any case there is no 100% reliable way to do it, people who are specifically seeking to get around it will still be able to do so, but you can eliminate casual clickage. :yes
That being said, the COM gurus here might know a more elemental way to achieve this.
TJ_Tigger
01-30-2006, 07:32 PM
The problem is that you cannot stop the navigation process once it has begun in the web Object. One thing you could do is have a timer that checks to see if the shift key is down and disables the web object while it is pressed.
Maybe something like this on a timer that fires every 100-250 milliseconds.
if System.IsKeyDown(16) then
Web.SetEnabled("Web1", false);
else
if not Web.IsEnabled("Web1") then
Web.SetEnabled("Web1", true);
end
end
Corey
01-30-2006, 07:34 PM
That's a cool idea. :yes
TJ_Tigger
01-30-2006, 07:35 PM
If you are ambitious enough you can also combine this with the System.GetMousePosition to determine if the mouse is over the web object and only disable if it is.
It would be great if there was an event for the web object that could be triggered before navition occurs. Before Navigation, On Navigation, On Loaded. There have been times in the past where I wanted to capture a navigation before it actually tries to navigate and stop the process. Not an easy thing to do.
Tigg
craigedmonds
01-30-2006, 08:03 PM
I just trialled a piece of cool and easy to use software which seems toprevent right clicking, images etc.
HTMLProtector from antssoft.com - works pretty good.
I am trying the timer suggection now by TJ_Tigger which is a pretty logical solution.
I have looked at this thread in order to understand timers etc...
http://www.indigorose.com/forums/showthread.php?t=3384
I have put this code into the On Timer Tab...
01. Page.StartTimer(250)
02. if System.IsKeyDown(16) then
03. Web.SetEnabled("Web1", false);
04. else
05. if not Web.IsEnabled("Web1") then
06. Web.SetEnabled("Web1", true);
07. end
08. end
I can still shift click.
Have I put the code in the correct place?
Thanks for you help.
TJ_Tigger
01-30-2006, 08:45 PM
The Page.StartTimer should go on the page On Show event the rest goes on the On Timer event.
craigedmonds
01-30-2006, 08:55 PM
Thanks Tigs,
That works pretty good.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.