revBrowserOpen versus revBrowserOpenCef
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 93
- Joined: Tue Nov 17, 2009 6:47 pm
- Location: Wellington, New Zealand
revBrowserOpen versus revBrowserOpenCef
I remain somewhat confused about which function to use to initiate a browser instance on desktop. The Dictionary says to use revBrowserOpenCef() to initialise a new Chrome-based browser, but when I try this it has some issues. If I use revBrowserOpen() under Livecode 7.0 it works, but is it (automatically) the new (Chrome-based) browser? If so then revBrowserOpenCef() is essentially redundant?
Thanks clarification
Thanks clarification
Re: revBrowserOpen versus revBrowserOpenCef
HI pthirkell,
not redundant at all!
As you said, "revBrowserOpenCEF" will use the Chrome browser framework on Mac and Win!
A simple "revBrowserOpen" will use the Safari (Webkit) framework on Mac and the IE framework on Windows.
I thought this would be nonambiguous
Anyway, what issues are you experiencing?
Best
Klaus
not redundant at all!
As you said, "revBrowserOpenCEF" will use the Chrome browser framework on Mac and Win!
A simple "revBrowserOpen" will use the Safari (Webkit) framework on Mac and the IE framework on Windows.
I thought this would be nonambiguous
Anyway, what issues are you experiencing?
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 93
- Joined: Tue Nov 17, 2009 6:47 pm
- Location: Wellington, New Zealand
Re: revBrowserOpen versus revBrowserOpenCef
Thanks Klaus for prompt reply.
I became confused after reading the very good Embedded Web article as part of the recent 7 Benefits of 7 piece in the October Livecode Newsletter. The article leads off by saying that "the new implementation of the CEF Browser Object means that developers can create hybrid apps that incorporate web content easily with consistent content on Mac and Windows," suggesting that we need to use revBrowserOpenCef() when instantiating a new browser object. The Embedded Web article includes a helpful video demo by Ben from Day 1 of this year's conference.
Yet when I look at the stack example provided by Ben for that demo, his code uses revBrowserOpen() - i.e...
put revBrowserOpen(the windowId of this stack, "file://"&stackPath()&"/index2.html") into sBrowserID
Secondly, a point of clarification. Can I use revBrowserAddJavaScriptHandler with revBrowserOpen() or does it require revBrowserOpenCef() ?
Thirdly, and more generally (and forgiving my lack of knowledge - maybe I should have posted in the beginners forum ) ... what does the Chrome Browser allow that the Webkit/Explorer browser doesn't allow? In other words why should I need to use revBrowserOpenCef() ?
Fourthly, the particular problem I have is that revBrowserOpenCef() doesn't allow proper playback of movies. If I create a new main stack, make it a little bigger (say 1200 by 900), and add a button near the bottom of the card with the following script ...
on mouseUp
local tBrowserId,tResizeBrowser
put revBrowserOpen(the windowId of this stack, "http://www.apple.com/watch/films/") into tBrowserId
put "0,0," & the width of this stack & "," & the height of this stack -50 into tResizeBrowser
revBrowserSet tBrowserId, "rect", tResizeBrowser
end mouseUp
then it works when I play any of the movies listed ... (well except for the fullscreen option on the player controller which I have logged as a bug).
If however I use the same script but with revBrowserOpenCef() instead of revBrowserOpen(), then the movie player doesn't load fully. Maybe a bug?
Thanks any further advice/guidance.
I became confused after reading the very good Embedded Web article as part of the recent 7 Benefits of 7 piece in the October Livecode Newsletter. The article leads off by saying that "the new implementation of the CEF Browser Object means that developers can create hybrid apps that incorporate web content easily with consistent content on Mac and Windows," suggesting that we need to use revBrowserOpenCef() when instantiating a new browser object. The Embedded Web article includes a helpful video demo by Ben from Day 1 of this year's conference.
Yet when I look at the stack example provided by Ben for that demo, his code uses revBrowserOpen() - i.e...
put revBrowserOpen(the windowId of this stack, "file://"&stackPath()&"/index2.html") into sBrowserID
Secondly, a point of clarification. Can I use revBrowserAddJavaScriptHandler with revBrowserOpen() or does it require revBrowserOpenCef() ?
Thirdly, and more generally (and forgiving my lack of knowledge - maybe I should have posted in the beginners forum ) ... what does the Chrome Browser allow that the Webkit/Explorer browser doesn't allow? In other words why should I need to use revBrowserOpenCef() ?
Fourthly, the particular problem I have is that revBrowserOpenCef() doesn't allow proper playback of movies. If I create a new main stack, make it a little bigger (say 1200 by 900), and add a button near the bottom of the card with the following script ...
on mouseUp
local tBrowserId,tResizeBrowser
put revBrowserOpen(the windowId of this stack, "http://www.apple.com/watch/films/") into tBrowserId
put "0,0," & the width of this stack & "," & the height of this stack -50 into tResizeBrowser
revBrowserSet tBrowserId, "rect", tResizeBrowser
end mouseUp
then it works when I play any of the movies listed ... (well except for the fullscreen option on the player controller which I have logged as a bug).
If however I use the same script but with revBrowserOpenCef() instead of revBrowserOpen(), then the movie player doesn't load fully. Maybe a bug?
Thanks any further advice/guidance.
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: revBrowserOpen versus revBrowserOpenCef
This is my experience:
On Mac I don't use revBrowserOpenCEF until now, because it is not yet able to display local PDFs (while revBrowserOpen does).
On Windows it displays local and remote PDFs and (for me) also perfectly displays/streams youTube videos (flash).
Of course you need new (may be the newest) FlashPlayer and Reader plugins for that from Adobe.
On Mac I don't use revBrowserOpenCEF until now, because it is not yet able to display local PDFs (while revBrowserOpen does).
On Windows it displays local and remote PDFs and (for me) also perfectly displays/streams youTube videos (flash).
Of course you need new (may be the newest) FlashPlayer and Reader plugins for that from Adobe.
shiftLock happens
Re: revBrowserOpen versus revBrowserOpenCef
1) revBrowserOpenCef supports HTML5 code while revBrowserOpen dosent
2) If you use revBrowserOpenCef in your code your Externals folder will jump up to 60mb while revBrowserOpen is about 1mb if i recall
Conclusion, if you are not going to load HTML5 then dont use revBrowserOpenCef, alteast not untill they make those externals a bit smaller
2) If you use revBrowserOpenCef in your code your Externals folder will jump up to 60mb while revBrowserOpen is about 1mb if i recall
Conclusion, if you are not going to load HTML5 then dont use revBrowserOpenCef, alteast not untill they make those externals a bit smaller
Knowledge is meant to be shared.
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: revBrowserOpen versus revBrowserOpenCef
This is very interesting, I must have missed this.zaxos wrote: revBrowserOpenCef supports HTML5 code ...
Could you please give a short example line how to display a local PDF on Mac with revBrowserOpenCEF (what is certainly, in some way, possible in HTML5)?
shiftLock happens
Re: revBrowserOpen versus revBrowserOpenCef
Hi there [-hh], hers a code i tested on windows and worked, i dont have MAC so its up to you to tell us if it works:
HTML:
Livecode:
HTML:
Code: Select all
<head>
<title></title>
<body>
<embed src="test.pdf" width="600" height="500" alt="pdf" pluginspage="http://www.adobe.com/products/acrobat/readstep2.html">
</body>
</head>
Code: Select all
on mouseUp
repeat for each item theItem in revBrowserInstances()
revBrowserClose theItem
end repeat
put revBrowserOpenCef(the windowID of this stack , "D:\test.html") into tBrowserID
revBrowserSet tBrowserID, "rect", the rect of grc "Browser"
end mouseUp
Knowledge is meant to be shared.
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: revBrowserOpen versus revBrowserOpenCef
Hi zaxos.
Good idea to embed this, but sadly it also doesn't work on Mac ("couldn't load plugin").
The same code, with revBrowserOpen only, works. I reported this as a bug (may be this is not the culprit of LC, but comes from the CEF on Mac).
p.s. On Windows I had also success with the "direct" call (of the PDF) by the CEF:
Good idea to embed this, but sadly it also doesn't work on Mac ("couldn't load plugin").
The same code, with revBrowserOpen only, works. I reported this as a bug (may be this is not the culprit of LC, but comes from the CEF on Mac).
p.s. On Windows I had also success with the "direct" call (of the PDF) by the CEF:
Code: Select all
put revBrowserOpenCEF(the windowID of this stack , \
"file:" && "C:/Users/hh/Documents/test.pdf") into tBrowserID
shiftLock happens
Re: revBrowserOpen versus revBrowserOpenCef
MAC does not support adobe flash if i recall, maybe thats the problem..
Knowledge is meant to be shared.
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: revBrowserOpen versus revBrowserOpenCef
Also on Mac revBrowserOpen works, with both local and remote PDF (Reader plugin) and also flv streaming (Flash Plugin).
And revBrowserOpenCEF works also on Mac with *remote* embedded PDF (Reader plugin). That is to have this with a local PDF one has to run a local webServer
And revBrowserOpenCEF works also on Mac with *remote* embedded PDF (Reader plugin). That is to have this with a local PDF one has to run a local webServer
shiftLock happens
-
- VIP Livecode Opensource Backer
- Posts: 47
- Joined: Thu Apr 27, 2006 11:19 pm
- Location: Seattle
Re: revBrowserOpen versus revBrowserOpenCef
Hi All,
I know this is an old thread but I have a similar problem. I’m trying to display a local pdf in a browser on Mac (10.9.5). I’ve tried LC 7.1 rc2 and LC 8.0 dp4. I’ve also tried both revBrowserOpen and revBrowserOpenCEF.
See my script below and the file path. Any suggestions?
Thanks,
Jim L.
Here’s what my file path looks like.
file://Users/littlejamesw/Desktop/GardenAidLC8/GardenAidLC8Files/MGFactSheets/MG10.pdf
I know this is an old thread but I have a similar problem. I’m trying to display a local pdf in a browser on Mac (10.9.5). I’ve tried LC 7.1 rc2 and LC 8.0 dp4. I’ve also tried both revBrowserOpen and revBrowserOpenCEF.
See my script below and the file path. Any suggestions?
Thanks,
Jim L.
Code: Select all
on menupick pPick
local tActiveURL
set the defaultFolder to (tDefaultFolder & "/" & "MGFactSheets")
put "file:/" & the defaultFolder & "/" & pPick into tActiveURL
put tActiveURL into msg
put the windowid of this stack into tWinID
put revBrowserOpen(tWinID,"") into sBrowserId
revBrowserSet sBrowserId, "rect", rect of grc "BrowserRect"
revBrowserSet sBrowserId, "url", tActiveURL
end menupick
file://Users/littlejamesw/Desktop/GardenAidLC8/GardenAidLC8Files/MGFactSheets/MG10.pdf
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: revBrowserOpen versus revBrowserOpenCef
Please try (watch the second slash)
Code: Select all
put "file://" & ..
shiftLock happens