revBrowserCEF - Handle New Window/Tab Request
Posted: Mon Mar 28, 2016 12:50 am
I need to serve up this link in an LC browser: http://viewer.zmags.com/publication/bc1cdb39. Several of the buttons in the top center do not work within LC's browser, because they launch a new page/tab. Ideally, I would handle the new page requests by seeing messages and launching the new URLs in a default browser outside of LC. (There is a confirmed bug with revBrowser loading this page, and others like it, in Mac, so I'm using revBrowserCef).
Setting the above to TRUE will allow the buttons to open a new browser window to serve up the second URL. But that opens an LC browser window that looks like a new stack and has no window ID or stack ID of its own, so you can't close, move or change the window by script. Surprisingly, its created in a reasonable size, which shape and size are not shared with any other windows. I think the default window is 0,0,0,0, so something is guiding it. RevBrowserInstances() returns one ID even thought both browser windows are open and functioning. When each window is selected separately, their ID results are the same number.
The browserBeforeNavigate message is sent only when "newwindow" above is set to TRUE. I can get the URL of the new page from the browserBeforeNavigate handler and launch it in an external browser, but not without first getting that initial un-scriptable browser window. There are no visible messages sent before the initial browser window is created and none after browserBeforeNavigate, although it looks like there should be plenty.
Above is set to TRUE in hopes of seeing more messages like browserBeforeNavigate. None of these messages show up on Mac with or without "newwindow" set to TRUE:
on browserNewUrlWindow pInstanceId, pUrl
on browserNewInstance pInstanceId
on browserDocumentFailedFrame pInstanceId, pUrl, pErrorMessage
on browserDocumentFailed pInstanceId, pUrl, pErrorMessage
on browserOut pInstanceId, pElementId
on browserOver pInstanceId, pElementId
browserOver -- may not show up due to no object name, but HTML looks like there is an ID (id="div_21")
browserOut -- may not show up due to no object name, but HTML looks like there is an ID (id="div_21")
browserClick -- windows only makes this unhelpful
global browserCancel
put true into browserCancel - stops browser progress but no place to put it to stop initial browser window
If I could just script this initial window or prevent it from being created, that would help. Would inserting a javascript help, if there is no solution to the above?
Code: Select all
revBrowserSet the altBrowserId of this stack, "newwindow", true
The browserBeforeNavigate message is sent only when "newwindow" above is set to TRUE. I can get the URL of the new page from the browserBeforeNavigate handler and launch it in an external browser, but not without first getting that initial un-scriptable browser window. There are no visible messages sent before the initial browser window is created and none after browserBeforeNavigate, although it looks like there should be plenty.
Code: Select all
revBrowserSet the altBrowserId of this stack, "messages", true"
on browserNewUrlWindow pInstanceId, pUrl
on browserNewInstance pInstanceId
on browserDocumentFailedFrame pInstanceId, pUrl, pErrorMessage
on browserDocumentFailed pInstanceId, pUrl, pErrorMessage
on browserOut pInstanceId, pElementId
on browserOver pInstanceId, pElementId
browserOver -- may not show up due to no object name, but HTML looks like there is an ID (id="div_21")
browserOut -- may not show up due to no object name, but HTML looks like there is an ID (id="div_21")
browserClick -- windows only makes this unhelpful
global browserCancel
put true into browserCancel - stops browser progress but no place to put it to stop initial browser window
If I could just script this initial window or prevent it from being created, that would help. Would inserting a javascript help, if there is no solution to the above?