Skip to content

Commit fd9cd23

Browse files
committed
chore: show reported browser in rondo
1 parent b45d144 commit fd9cd23

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

test/e2e/index.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<h1 class="display-4">Rondo Web</h1>
3737
<p class="lead">Facilitates testing of the Leanplum Web SDK.</p>
3838
<p>SDK version: <span id="sdkVersion"></span></p>
39+
<p>Browser: <span id="browserVersion"></span></p>
3940
</div>
4041

4142
<div class="session-status">
@@ -302,7 +303,16 @@ <h2 class="card-title">
302303
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
303304
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
304305
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
305-
<script src="leanplum.js"></script>
306-
<script src="index.js"></script>
306+
<script>
307+
(function load(scripts) {
308+
const src = scripts.shift();
309+
if (!src) return;
310+
const s = document.createElement('script');
311+
s.src = src + '?' + Date.now();
312+
document.body.appendChild(s);
313+
314+
s.onload = () => load(scripts);
315+
})(['leanplum.js', 'index.js']);
316+
</script>
307317
</body>
308318
</html>

test/e2e/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import { RenderOptions } from '../../dist/leanplum'
33

44
const isProdKey = (accessKey: string): boolean => /^prod_/.test(accessKey)
55

6+
const d = (Leanplum as any)._lp._browserDetector;
7+
const browser = `${d.browser} ${d.version}, running on ${d.OS}`;
8+
$('#browserVersion').text(browser);
9+
610
$('[data-action=setup]')
711
.submit((e) => {
812
e.preventDefault()

0 commit comments

Comments
 (0)