Browser HTML Source & URLs
J. Landman Gay
jacque at hyperactivesw.com
Wed Apr 17 14:57:21 EDT 2019
Try this:
put url tURL into tSource -- the source text
set the htmlText of fld "HTMLText" to tSource -- LC's display
LC only supports a subset of HTML, so when you put the source into a
field, only the supported parts go in. But you can grab the unadultered
source first.
On 4/17/19 1:22 PM, Rick Harrison via use-livecode wrote:
> Thanks for getting back to me on this.
>
>> The htmltext is the page source code. So
>>
>> put the htmltext of widget "browser" into field 1
>
> I thought it was the source code originally too,
> but it doesn’t work correctly.
>
> For example:
>
> set the HTMLText of field "HTMLTextField1" to URL field "WebAddressField1" of this card
> (Where field "WebAddressField1" of this card = http://www.duckduckgo.com <http://www.duckduckgo.com/> )
>
> Look at the output in field HTMLTextField1.
>
> Then go to the website with Safari with the Developer Menu turned on,
> and use the pull down menu option for “Show Page Source”.
>
> You will see there is a vast difference between what Safari shows
> versus what LiveCode HTMLText shows. (It’s less than useful!)
>
> Your thoughts?
>
> Thanks,
>
> Rick
>
>
>
>> On Apr 17, 2019, at 6:13 AM, hh via use-livecode <use-livecode at lists.runrev.com> wrote:
>>
>>> Rick H. wrote:
>>> I am able to load the browser widget with a URL
>>> and go to the URL successfully.
>>>
>>> I can get the HTMLtext of the page I have browsed to just fine.
>>> What I have yet to do is to get the page source code of the page
>>> I have browsed to in LiveCode into a field.
>>
>> The htmltext is the page source code. So
>>
>> put the htmltext of widget "browser" into field 1
>>
>> If you don't mean the htmltext but the *generated* htmltext then you
>> have to use JavaScript (see for example the firefox developer tools).
>>
>>> Rick H. wrote:
>>> I also would like the browser widget to show me any new URL address
>>> that I have gone to.
>>
>> This stack shows also one way how to implement "history" for the widget
>> in a few lines:
>> http://forums.livecode.com/viewtopic.php?p=174936#p174936
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list