Browser Widget & Web-Plugins

LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.

Moderators: LCMark, LCfraser

Post Reply
PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Browser Widget & Web-Plugins

Post by PaulDaMacMan » Thu Oct 05, 2017 11:25 pm

I'm using the browser widget to execute JavaScripts that load a web-plugin on Mac OS X. I'm pretty sure the plug-in is "fat" both 32bits and 64bit, it works fine in 64bit web browsers, however it crashes when it gets called to load from the LiveCode browser widget unless I set the engine to run in 32bit mode (which it seems was the default mode until recently) and then it loads just fine. So is this bug report worthy bug do you think? It seems like it should work, or at least fail a little more gracefully if it turns out it isn't a 64-bit plugin.
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Browser Widget & Web-Plugins

Post by [-hh] » Sun Oct 08, 2017 8:12 pm

Hi Paul,

perhaps a feature request is more adequate than a bug report?
AFAIK plugin handling is done by the browsers and not (at least not comfortably) supported by the frameworks, so rather a feature for a simple widget.

To see it positive: You could tell the users of your app how they can have your stack with the plugin working: One single click on the "Open in 32bit mode" check button in Finder's info of the LC app is not this much work...

H.
shiftLock happens

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: Browser Widget & Web-Plugins

Post by PaulDaMacMan » Mon Oct 09, 2017 7:14 pm

Well yes, I do mention that if the user is using the latest developer previews of LC9 on Mac OS X then they will need to "Open in 32 bit mode" (though maybe a little tutorial on exactly how to do that might help). The default on Mac OS until recent builds seems to have been 32bit mode. But shouldn't 32bit and 64bit have feature parity? And if Browser instances use the WebKit that is in the Mac OS X system, and if Safari, using the same WebKit and running in 64bit mode loads the very same plug-in without issue, wouldn't that make this a bug in the LiveCode browser instance implimentation?

Here's my stack, just in case anyone is interested:
http://livecodeshare.runrev.com/stack/847/HyperTalkMIDI
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1206
Joined: Thu Apr 11, 2013 11:27 am

Re: Browser Widget & Web-Plugins

Post by LCMark » Tue Oct 10, 2017 12:03 pm

@PaulDaMacMan: The browser widget is just a thing wrapper around the Mac WebKit/WebView (Obj-C) framework. The crash isn't happening in LiveCode, but in the PluginHost process which loads and runs plugins (WebKit uses process separation to guard against rogue / bad plugins).

Unfortunately, I think the problem might be with the JazzSoft plugin, rather than with LiveCode or WebKit http://jazz-soft.org/bb/viewtopic.php?f=2&t=236.

That forum thread is a few years old, but the crashlog reported there is pretty much the same as the one I see when loading the jazz-soft site in a browser widget.

It might be worth contacting JazzSoft and asking them whether they ever managed to solve that problem.

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: Browser Widget & Web-Plugins

Post by PaulDaMacMan » Tue Oct 10, 2017 6:37 pm

Hmmm, that is strange because I've been working with this setup (JAZZ-Plugin in a WebKit view) for more than a year but I only recently started having problems with it in newer builds of LC9dp8+9 (since 64bit mode became the default) and even then it usually runs just fine in 32bit mode (though the plug-in does still randomly crash occasionally now). Older builds and LC8 (in 32bit mode by default) do not seem to have the same issues. It could be something introduced in the latest version of the plug-in I guess (updated back in May I think). I'm thinking it has something to do with 64-bit Webkit views.
Hopefully someday someone (myself?) will be able to wrap a cross-platform MIDI lib (fluidSynth) with LCB and render this problem obsolete.
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: Browser Widget & Web-Plugins

Post by PaulDaMacMan » Tue Oct 10, 2017 10:31 pm

I emailed JAZZ-Plugin developer about it and to get more general info. Is there a way to tell if a Web Plug-in binary has 64bit code? (Like how you can get that info on kernel extensions with KEXT tool CLI)
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1206
Joined: Thu Apr 11, 2013 11:27 am

Re: Browser Widget & Web-Plugins

Post by LCMark » Wed Oct 11, 2017 8:41 am

@PaulDaMacMan: If you locate the plugin's bundle, then you can use 'otool' from the command line to find out what slices are in a Mac executable:

Code: Select all

  otool -hv <pathtobundle>/Contents/MacOS/<executablefile>
Typically the executablefile is the same name as bundle - although can vary.

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1206
Joined: Thu Apr 11, 2013 11:27 am

Re: Browser Widget & Web-Plugins

Post by LCMark » Wed Oct 11, 2017 9:22 am

@PaulDaMacMan: It does sound like a 64-bit issue - as the plugin does seem to run fine in 32-bit LiveCode in the browser widget on my system. Is an older version of the JazzPlugin available to download? Perhaps you could try and see if an older version works in 64-bit, it might help them track down the issue.

In regards to fluidSynth, then the API looks quite well designed using opaque pointer types - which are generally the easiest to wrap with LCB.

Post Reply

Return to “LiveCode Builder”