13 Replies Latest reply on Jan 8, 2018 1:54 AM by Martin Sramo

    Enterprise Browser CustomDOM

    Martin Sramo

      Hi everybody, I just run into some strange situation with Enterprise Browser. I wanted to use Custom DOM feature, so I prepared some javascripts to inject. Some of them do some stuff at page load, like looking for 'bgsound' tag and playing custom sound using Notification API. Everything was looking fine until I left the device (TC8000) on the desk for a while. When I came back, device was at sleep of course. I woke it up, refreshed the page and I noticed my custom wav file sounds strange, like it tries to run it several times. So I started to dig deeper what could be the problem and finally I end with a very easy way to reproduce my situation.


      These are the steps:

      1. install EB from scratch (or delete config.xml to force EB to recreate)

      2. in default config, change only the start page (I used google.com) and path to CustomDOMElements tags file (tags.txt in my case)

      3. use tags file with only one javascript file (test.js in my case)

      4. in the javascript file, only use alert() function to show a message at every page load

      5. start EB and browse a few pages, everything should be working fine, for every page an alert should show up

      6. put the device to sleep by pressing Power button and wake it up after a few seconds (or you can wait for display timeout)

      7. now browse a few pages again

      In my case, at this step, I got 2 to 15 (or more) alerts for every page. At first, I though that after every sleep, one alert is added, but I left the device in sleep for about a minute and after wake up, I got 15 alerts for every page.


      Finally I turned on debug mode in EB and checked the source in Chrome developer tools. I noticed, that after initial EB startup, only one "script code" is added into HEAD section using DOM injection. But when I sleep/wake device and reload a page, "script code" is multiplied in the source code. Like this:


      The number of multiplications stays the same for every page, until I sleep the device again. Then the code is multiplied even more times. When you restart EB, it will start from one again.


      I use TC8000 with latest OS patch (Lollipop) and EB I tried two TC8000s and TC56 (Marshmallow) with the same results. I also tried EB 1.6, again with the same results.


      This is all I was able to gather I work with EB only for a short time so I guess I could easily make some mistake or forgot something. I tried to find an answer on techdocs at first, but I was not lucky. I also attached abovementioned files including config.xml and log.txt (enabled log for everything).


      I would appreciate any help to solve the situation.


      Thank you very much in advance.