Skip to content

Commit

Permalink
ADD version to iframe-dev-event
Browse files Browse the repository at this point in the history
  • Loading branch information
pubkey committed Jul 7, 2024
1 parent ac118f2 commit ec9e7dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs-src/static/html/dev-mode-iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@
<script src="/js/analytics.js"></script>
<script>
const EVENT_ID = 'dev_mode_tracking_iframe';
const searchParams = new URLSearchParams(window.location.search);
const version = searchParams.get('version');
if (!localStorage.getItem(EVENT_ID)) {
console.log('track me');
localStorage.setItem(EVENT_ID, '1');
window.trigger(EVENT_ID, 10);
window.trigger(EVENT_ID + '_' + version, 10);
} else {
console.log('tracked already');
}
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/dev-mode/dev-mode-tracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { RxDatabase } from '../../types';
import {
PREMIUM_FLAG_HASH,
RXDB_UTILS_GLOBAL,
RXDB_VERSION,
defaultHashSha256
} from '../utils/index.ts';

Expand Down Expand Up @@ -48,7 +49,7 @@ export async function addDevModeTrackingIframe(db: RxDatabase) {

const iframe = document.createElement('iframe');
iframe.style.display = 'none';
iframe.src = 'https://rxdb.info/html/dev-mode-iframe.html'
iframe.src = 'https://rxdb.info/html/dev-mode-iframe.html?version=' + RXDB_VERSION;
document.body.appendChild(iframe);
}

Expand Down

0 comments on commit ec9e7dc

Please sign in to comment.