fix(01-review): IN-01 read extensionVersion from chrome.runtime.getManifest()
This commit is contained in:
@@ -361,11 +361,17 @@ async function createArchive(
|
|||||||
logger.log('✓ Added screenshot');
|
logger.log('✓ Added screenshot');
|
||||||
|
|
||||||
// Добавляем метаданные
|
// Добавляем метаданные
|
||||||
|
// IN-01 fix: read version from manifest at runtime instead of the
|
||||||
|
// hardcoded '1.0.0'. Previously the metadata would silently lie about
|
||||||
|
// the running version once manifest.json bumps to 1.0.1+. The Chrome
|
||||||
|
// runtime API is always available in the SW context, so no fallback
|
||||||
|
// is needed.
|
||||||
|
const manifest = chrome.runtime.getManifest();
|
||||||
const metadata: SessionMetadata = {
|
const metadata: SessionMetadata = {
|
||||||
timestamp: new Date().toISOString(),
|
timestamp: new Date().toISOString(),
|
||||||
url: new URL(chrome.runtime.getURL('')).origin,
|
url: new URL(chrome.runtime.getURL('')).origin,
|
||||||
userAgent: navigator.userAgent,
|
userAgent: navigator.userAgent,
|
||||||
extensionVersion: '1.0.0',
|
extensionVersion: manifest.version,
|
||||||
videoBufferSeconds: 30,
|
videoBufferSeconds: 30,
|
||||||
logDurationMinutes: 10,
|
logDurationMinutes: 10,
|
||||||
totalEvents: rrwebEvents.length + userEvents.length
|
totalEvents: rrwebEvents.length + userEvents.length
|
||||||
|
|||||||
Reference in New Issue
Block a user