This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Setup listener for page unload event | |
* @see https://developers.google.com/web/updates/2018/07/page-lifecycle-api | |
*/ | |
const terminationEvent = 'onpagehide' in window ? 'pagehide' : 'unload'; | |
window.addEventListener( | |
terminationEvent, | |
() => { | |
// Note: if the browser is able to cache the page, `event.persisted` | |
// is `true`, and the state is frozen rather than terminated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
thrift --gen js:ts PagePerformance.thrift |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Task from '../Task'; | |
class PerformanceTask extends Task { | |
start({ payload }: { payload: PartnerAnalyticsPageRequest }): Promise<any> { | |
return new Promise(resolve => { | |
const { | |
navigationStart, | |
unloadEventStart, | |
unloadEventEnd, | |
redirectStart, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Autogenerated by Thrift Compiler (0.11.0) | |
// | |
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING | |
// | |
/** | |
* Page Performance gathered from the browser window.performance.timing | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Page Performance gathered from the browser window.performance.timing | |
*/ | |
struct PagePerformance { | |
1: optional i64 navigation_start, | |
2: optional i64 unload_event_start, | |
3: optional i64 unload_event_end, | |
4: optional i64 redirect_start, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script async defer src="//widget.getyourguide.com/v2/widget.js"></script> | |
<div | |
data-gyg-id="test" | |
data-gyg-widget="activities" | |
data-gyg-href="https://widget.getyourguide.com/default/activites.frame" | |
data-gyg-number-of-items="4" | |
data-gyg-locale-code="eu-AU" | |
data-gyg-iata="TRC" | |
></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright 2011 Martin Hawksey | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |