Display webpage without browser function

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
Saman Sjr.
Posts: 49
Joined: Sat Nov 30, 2013 6:40 am

Display webpage without browser function

Post by Saman Sjr. » Wed Aug 13, 2014 8:27 am

Dear all,
how do i display webpage in an image area without browser function?

regard's
Saman Sjr.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Display webpage without browser function

Post by Simon » Wed Aug 13, 2014 9:34 pm

Hi Saman,
Now this is an odd request :)
Are there images in the html page? Is there javascript in the page?
I'm trying to guess why you'd want a webpage as an image... Here lets waste some time together;

Code: Select all

set the filename of img 1 to url("http://www.mycrazysite.com/myImage.jpg")

Code: Select all

set the htmlText of fld 1 to url("http://www.myTimeSpent.com/guessingAtTheQuestion.html")
export snapshot from fld 1....
In Windows you do a prtSc of your browser and save it as an image.

HoHum, do I go on?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Saman Sjr.
Posts: 49
Joined: Sat Nov 30, 2013 6:40 am

Re: Display webpage without browser function

Post by Saman Sjr. » Thu Aug 14, 2014 1:55 am

Hello Simon,

maybe i'm made a wrong explanation about the browser function.
actually what i want is how to disable a link in browser object (image area).

nice to meet you Simon.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Display webpage without browser function

Post by Simon » Thu Aug 14, 2014 6:39 pm

Hi Saman,
Is "on browserBeforeNavigate" what you are looking for?
If you know the URL (or part of it) then you can block it.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Saman Sjr.
Posts: 49
Joined: Sat Nov 30, 2013 6:40 am

Re: Display webpage without browser function

Post by Saman Sjr. » Fri Aug 15, 2014 1:19 am

Simon,
it's my first time learning about internet related stuff with livecode,
hope you can give detail example "on browserBeforeNavigate".

Kind regard's
Saman Sjr.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1682
Joined: Sat Feb 28, 2009 11:49 pm

Re: Display webpage without browser function

Post by sturgis » Tue Dec 16, 2014 9:13 pm

if you look in the dictionary under browserbeforenavigate, you can see that its does what it says. The message fires before the navigation actually occurs.

Near the bottom of the dictionary entry it says this: "To prevent the navigatation from occurring, set the global variable browserCancel to true."

so, to stop navigation from happening something like this should work..

Code: Select all

on browserbeforenavigate pInstance,pUrl
global browserCancel -- define the scope.. I think this is necessary.  
put true into browserCancel -- sets the variable to true so LC knows to cancel the navigation.

end browserbeforenavigate
You could always check the URL of course to see if you actually want to cancel or not.

rickychou
Posts: 2
Joined: Fri Jan 23, 2015 7:51 am

Re: Display webpage without browser function

Post by rickychou » Fri Jan 23, 2015 4:06 pm

sturgis wrote:if you look in the dictionary under browserbeforenavigate, you can see that its does what it says. The message fires before the navigation actually occurs.

Near the bottom of the dictionary entry it says this: "To prevent the navigatation from occurring, set the global variable browserCancel to true."

so, to stop navigation from happening something like this should work..

Code: Select all

on browserbeforenavigate pInstance,pUrl
global browserCancel -- define the scope.. I think this is necessary.  
put true into browserCancel -- sets the variable to true so LC knows to cancel the navigation.

end browserbeforenavigate
You could always check the URL of course to see if you actually want to cancel or not.
So sorry but i still can not understand it clearly :((((

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1682
Joined: Sat Feb 28, 2009 11:49 pm

Re: Display webpage without browser function

Post by sturgis » Fri Jan 23, 2015 4:34 pm

If a user clicks on a link, before the navigation to the new URL is done, the message "browserbeforenavigate" is sent.


Say you have a page with 3 links on it. And you only want one of the links to actually do something..
If your links are:
htp://www.myurl.com/link1
htp://www.myurl.com/link2
htp://www.myurl.com/link3

And you only want link2 to work you can set things up like this..

Code: Select all

on browserbeforenavigate pInstanceid, pUrl -- pInstancId is the id of the browser, pUrl is the link clicked.
    if pURL is not "http://www.myurl.com/link2" then put true into browserCancel -- will cancel any link except link2

end browserbeforenavigate

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7717
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Display webpage without browser function

Post by FourthWorld » Fri Jan 23, 2015 5:47 pm

With great power comes great responsibility.

There may be many good reasons to alter the behavior of links from pages hosted on your own site, but altering the behavior of links from sites owned by others can be viewed as hijacking that link.

For example, we could open a page with a link to the user's bank, and then route the request to a page we've designed to spoof the bank to obtain the user's login credentials.

If the user discovers any form of link hijacking on their own (any differences in behavior between how a page reacts to links in your browser vs. any other browser), in these security-conscious times they may become suspicious of all URL handling within your app. Given the speed with which things flow through social media, any minor mistake can quickly become a PR nightmare.

Tread carefully.....
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Post Reply

Return to “Internet”