Add custom line to exported HTML for links to open in new tab

19 February 2018 12:35

I'm working on a project with some artists. They've created and exported an HTML of their Blend4Web project. Everything is working perfectly, except that we need the links activated by objects in the scene to open in a new tab (they open webpages with a looping video, there are 9 of them).

I can see several "window.location.href" and {\"url\": \"\"}

is there a way I can add a "target=_blank" to any of these lines? or even a canvas that controls this interaction. Anywhere i've tried to add this has either broken the code or had no effect. All URLS linked are on the same server so should not be a problem for browsers.

Any help would be greatly apreciated!

20 February 2018 10:24
See this topic. Follow the link and try the attached project. For your case you can write a similar project and ask your artists to export their models into json. The bahavior of logic nodes will be the same. Or you can patch a webplayer and src/intern/logic_nodes.js to replace the behavior of "Page Redirect" node. In your place I would choose the first solution because in this case you don't have to patch the core and the synchronization process between you and artists would be more easier.
Alexander (Blend4Web Team)
Please register or log in to leave a reply.