# HTML5 Export - Dependency on Fullscreen button

**URL:** <https://forums.unrealengine.com/t/html5-export-dependency-on-fullscreen-button/332263>\
**Category:** Platform & Builds\
**Tags:** HTML5, javascript, unreal-engine, Packaging, bug-report, UE4, question\
**Created:** [September 15, 2015, 12:50pm UTC](https://forums.unrealengine.com/t/html5-export-dependency-on-fullscreen-button/332263 "2015-09-15T12:50:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_1d9c3aac](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1d9c3aac](https://forums.unrealengine.com/u/anonymous_user_1d9c3aac)\
**Post date:** [September 15, 2015, 12:50pm UTC](https://forums.unrealengine.com/t/html5-export-dependency-on-fullscreen-button/332263/1 "2015-09-15T12:50:08Z")

</div>

_PS: If the tone sounds a little harsh, that was not my intent. Sorry for that._

Currently when you export to HTML5, you get a sample/template html file with the data.  
I have to say that this html has a lot of errors (especially closing tags that close nothing) and js part seems to be written in a hurry.

I have rewritten the js and html for my own taste, including the Module component. But when I tried to run the html, I also found that there is a dependency for the “fullscreen” button that appears in the template. Everything is deletable except this button. Removing the dependency is impossible for the developer as the code is precompiled + obfuscated + etc by emscripten…

If I’m correct, when UE4 is exporting the game code via emscripten, it imports another js file which includes the game + graphics engine for webgl. In there somewhere, someone forgot to add a check for existence of the button with id “fullscreen\_request”. As there is no “undefined/null” check, when the code hits, this error is thrown:

```
exception thrown: TypeError: Cannot read property 'addEventListener' of null,TypeError: Cannot read property 'addEventListener' of null
    at Object.JSEvents.registerOrRemoveHandler (blob:http%3A//xxx.xxx.xxx.xxx/4b1846e7-c655-4667-a3b0-5bbee1527377:1:44174)
    at Object.JSEvents.registerMouseEventCallback (blob:http%3A//xxx.xxx.xxx.xxx/4b1846e7-c655-4667-a3b0-5bbee1527377:1:47948)
    at _emscripten_set_click_callback (blob:http%3A//xxx.xxx.xxx.xxx/4b1846e7-c655-4667-a3b0-5bbee1527377:1:323575)
    at GbM (blob:http%3A//xxx.xxx.xxx.xxx/4b1846e7-c655-4667-a3b0-5bbee1527377:12:1099387)
    at o8L (blob:http%3A//xxx.xxx.xxx.xxx/4b1846e7-c655-4667-a3b0-5bbee1527377:12:1024521)
    at A4L (blob:http%3A//xxx.xxx.xxx.xxx/4b1846e7-c655-4667-a3b0-5bbee1527377:12:946409)
    at Array.NbM (blob:http%3A//xxx.xxx.xxx.xxx/4b1846e7-c655-4667-a3b0-5bbee1527377:12:1100143)
    at UZA (blob:http%3A//xxx.xxx.xxx.xxx/4b1846e7-c655-4667-a3b0-5bbee1527377:31:828251)
    at SZA (blob:http%3A//xxx.xxx.xxx.xxx/4b1846e7-c655-4667-a3b0-5bbee1527377:31:827899)
    at tB (blob:http%3A//xxx.xxx.xxx.xxx/4b1846e7-c655-4667-a3b0-5bbee1527377:24:161891)

```

If you can point me to these js files (if not obfuscated) I can remove the fullscreen button dependency and request a merge from Github.

---

<div class="post-metadata">

**Author:** ![JoJo\_2nd\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JoJo\_2nd\_1](https://forums.unrealengine.com/u/JoJo_2nd_1)\
**Post date:** [September 16, 2015, 8:28am UTC](https://forums.unrealengine.com/t/html5-export-dependency-on-fullscreen-button/332263/2 "2015-09-16T08:28:09Z")

</div>

Hi emrahgunduz,

> when UE4 is exporting the game code  
> via emscripten, it imports another js  
> file which includes the game +  
> graphics engine for webg  
> That’s not quite the case, the dependency is coming from the C++ code. You’re looking for a call to emscripten\_set\_click\_callback() in the FPlatformOpenGLDevice c’tor. I’m not sure a null check it needed there as my expectation is for that function to return an error in the case that button doesn’t exist. You may want to investigate what that function is doing by browsing through the emscripten SDK.

WRT the html template, I think it was only ever designed as an example that would be replaced and as such hasn’t got as much care as it possibly needs. If you do have improvements for it we’ll happy look at accepting a pull request 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_1d9c3aac](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1d9c3aac](https://forums.unrealengine.com/u/anonymous_user_1d9c3aac)\
**Post date:** [September 16, 2015, 12:52pm UTC](https://forums.unrealengine.com/t/html5-export-dependency-on-fullscreen-button/332263/3 "2015-09-16T12:52:57Z")

</div>

I have - currently, changed the template html so drastically I do not think that everybody would like that 🙂 . Yet it is modular and easily customizable.

I would **very much** like to give it a go for the cpp + html + js part on the export process.

If you can direct me, I’ll need the location in the source that has a part in exporting process. A source folder and/or a starting name is sufficient enough, I can work through that point and discover what is going on.

 ![58846-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/0/6/106f2a7e7a663a62f75ce5152aeaed2f9388ffac.jpeg)

 ![58847-2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/5/b/45b0ec6fdf556a04dcd7b351622f353bc3bdc38a.jpeg)

 ![58848-3.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/7/4/b74c2014f4a63803a69d840c755dab47d1b6317c.jpeg)

 ![58849-4.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/a/b/bab36b478c6d22b52ee30456cc5861a740ecd3b9.jpeg)

---

<div class="post-metadata">

**Author:** ![bzxo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@bzxo](https://forums.unrealengine.com/u/bzxo)\
**Post date:** [November 25, 2015, 9:51pm UTC](https://forums.unrealengine.com/t/html5-export-dependency-on-fullscreen-button/332263/4 "2015-11-25T21:51:43Z")

</div>

That template looks AMAZING. Any chance of sharing some bits?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_1d9c3aac](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1d9c3aac](https://forums.unrealengine.com/u/anonymous_user_1d9c3aac)\
**Post date:** [December 6, 2015, 11:05am UTC](https://forums.unrealengine.com/t/html5-export-dependency-on-fullscreen-button/332263/5 "2015-12-06T11:05:36Z")

</div>

well, i’ve changed the default js and html files to fit to my project. it involves messing with emscripten python files and it breaks the default html packaging for unreal. I needed this for a project that we are working on. Our deadline is in 2 weeks and I made a schedule to share everything that I’ve learned about Unreal Engine HTML, and also code that I wrote on Github. Including TCP sockets, a simle game server for simple multiplayer games, talking and listening javascript, and making sure that “download maps on the fly” works correctly. Just give me 2 weeks 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_586cbc0b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_586cbc0b](https://forums.unrealengine.com/u/anonymous_user_586cbc0b)\
**Post date:** [March 31, 2017, 7:36am UTC](https://forums.unrealengine.com/t/html5-export-dependency-on-fullscreen-button/332263/6 "2017-03-31T07:36:59Z")

</div>

would you mind to share the codes ?
