Welcome Guest (Log in)

WebkitField 1.3

Developer tool (33) | Development (24) | IOS (23) | Development tool (10) | Web (6) | RevBrowser (2) |
Expander triangle
  • Author
  • Rating
  • Type
  • Revision
  • Downloaded
  • Updated
  • Tim Bobo
  • StarStarStarStarStar
  • Stack
  • 1
  • 2101 Times
  • 18 July 2012
WebKit Field
This is a stack I created a couple of years ago to try to automate the use of the browser object on both iOS, Mac, and PC. My goal was to be be able to create a button, set a couple of custom properties, and then If I was using this stack in the background it would do the following.

1) detect the existence of the special button
2) create a browser object on whatever platform was being used
3) when the user left the card it would take a snapshot of the browser and use it for a transition animation
4) When the user came back to the card it would transition on with the last image and then invisibly switch to real content.
5) You can also preload a browser with an image for the first use, so the browser area can be used more like place to display highly customized text and graphical information, but not looke like a browser.

For the large part I was successful and have used this in several stacks. I recently added a card property that must exist too in order for the webkitfiled stack to even look for a browser on the card, this cut out a lot of potential errors and delays.

So to use the browser do the following
1) "Start using" this stack
2) create a hasBrowser property on your card in your stack and set it to true
3) create a property called "boboBrowserFile" and set it to the URL you want to dispaly. This can also be a path to a local file relative to the stack location.

The code is a bit of a mess. I have learned a lot since I first started coding this, and I have a few things in there for special situations. Like there is a catcher in there that if you have a URL with "livecode:commandName", it will catch this and send the command to the stack with the browser, allowing you to kick off a liveCode command from the browser. You would ONLY want to do this on local code that you control. So if you were to allow real browsing with thie browser, you would want to totally disable this feature.

I do plan to keep updating stack and cleaning it up until the time with the LiveCode team cleans up the disparities in their browser implementations. Even when they do, something that automates some of the work might be useful.
Ajax Loader
Expander triangle
User Comments
Expander triangle