Page 1 of 1

Direct to browser

Posted: Sat Aug 17, 2024 9:38 am
by richmond62
I have a field in a stack containing styled text, and I can easily export that to an HTML document, which I can then open subsequently in a web browser.

However, I would really like to open my styled text in a web browser WITHOUT having to mess around with the intermediate step of an HTML document.

Re: Direct to browser

Posted: Sat Aug 17, 2024 9:54 am
by richmond62

Re: Direct to browser

Posted: Sat Aug 17, 2024 10:03 am
by SparkOut
Change "runrev" to "livecode" in the url

Browsers in recent years have become more "funny/fussy" at opening local files.
If you use a browser widget or revBrowser from within LC, I think you should be able to set the browser content to the htmlText of your field. (I'm not sure about the state of LC browser options on Linux.)
If you want to have the separate browser receive your text somehow and display, you'd have to get quite involved with permissions and 3rd party automation.

Re: Direct to browser

Posted: Sat Aug 17, 2024 10:38 am
by richmond62
Thank you.

Yup: that was a bit sleepy of me not to change 'runrev' to 'livecode'.

Re: Direct to browser

Posted: Sat Aug 17, 2024 11:58 am
by richmond62
Not that that did me any good as I don't have a current LiveCode licence.

This strikes me as very odd as that bug report (and a considerable number of other ones) refers to the Open Source 'Community' versions: so should not all the bug reports that related to Open Source software also be freely available?

Re: Direct to browser

Posted: Sat Aug 17, 2024 12:08 pm
by SWEdeAndy
richmond62 wrote:
Sat Aug 17, 2024 9:38 am
I have a field in a stack containing styled text, and I can easily export that to an HTML document, which I can then open subsequently in a web browser.

However, I would really like to open my styled text in a web browser WITHOUT having to mess around with the intermediate step of an HTML document.
I don't think there's a way around it, but what you can do to make it as "invisible" as possible to the user, is to create the html doc in e.g. the Documents folder, launch it and (after a slight delay so it has time loading) have LiveCode delete it. You could append "the seconds" to the name to make sure (or extremely likely) that no file with that name already exists in the folder.