diff --git a/packages/web-extension/package.json b/packages/web-extension/package.json index 2a4c7b39be..f9f340a53c 100644 --- a/packages/web-extension/package.json +++ b/packages/web-extension/package.json @@ -19,6 +19,7 @@ }, "devDependencies": { "@rrweb/types": "^2.0.0-alpha.18", + "@types/chrome": "^0.0.287", "@types/react-dom": "^18.0.6", "@types/semver": "^7.5.8", "@types/webextension-polyfill": "^0.9.1", diff --git a/packages/web-extension/src/pages/Player.tsx b/packages/web-extension/src/pages/Player.tsx index f2e3498910..56f3fa4d00 100644 --- a/packages/web-extension/src/pages/Player.tsx +++ b/packages/web-extension/src/pages/Player.tsx @@ -1,3 +1,4 @@ +/// import { useRef, useEffect, useState } from 'react'; import { useParams } from 'react-router-dom'; import Replayer from 'rrweb-player'; @@ -29,9 +30,10 @@ export default function Player() { .then((events) => { if (!playerElRef.current) return; + const manifest = chrome.runtime.getManifest(); + const rrwebPlayerVersion = manifest.version_name || manifest.version; const linkEl = document.createElement('link'); - linkEl.href = - 'https://cdn.jsdelivr.net/npm/rrweb-player@alpha/dist/style.min.css'; + linkEl.href = `https://cdn.jsdelivr.net/npm/rrweb-player@${rrwebPlayerVersion}/dist/style.min.css`; linkEl.rel = 'stylesheet'; document.head.appendChild(linkEl); playerRef.current = new Replayer({ diff --git a/yarn.lock b/yarn.lock index 0cfcbe03b6..ddbfc5571e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2585,6 +2585,14 @@ dependencies: "@babel/types" "^7.20.7" +"@types/chrome@^0.0.287": + version "0.0.287" + resolved "https://registry.yarnpkg.com/@types/chrome/-/chrome-0.0.287.tgz#239969b1195b441836d2137125543b5241c41157" + integrity sha512-wWhBNPNXZHwycHKNYnexUcpSbrihVZu++0rdp6GEk5ZgAglenLx+RwdEouh6FrHS0XQiOxSd62yaujM1OoQlZQ== + dependencies: + "@types/filesystem" "*" + "@types/har-format" "*" + "@types/cookie@^0.6.0": version "0.6.0" resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.6.0.tgz#eac397f28bf1d6ae0ae081363eca2f425bedf0d5" @@ -2622,6 +2630,18 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== +"@types/filesystem@*": + version "0.0.36" + resolved "https://registry.yarnpkg.com/@types/filesystem/-/filesystem-0.0.36.tgz#7227c2d76bfed1b21819db310816c7821d303857" + integrity sha512-vPDXOZuannb9FZdxgHnqSwAG/jvdGM8Wq+6N4D/d80z+D4HWH+bItqsZaVRQykAn6WEVeEkLm2oQigyHtgb0RA== + dependencies: + "@types/filewriter" "*" + +"@types/filewriter@*": + version "0.0.33" + resolved "https://registry.yarnpkg.com/@types/filewriter/-/filewriter-0.0.33.tgz#d9d611db9d9cd99ae4e458de420eeb64ad604ea8" + integrity sha512-xFU8ZXTw4gd358lb2jw25nxY9QAgqn2+bKKjKOYfNCzN4DKCFetK7sPtrlpg66Ywe3vWY9FNxprZawAh9wfJ3g== + "@types/fs-extra@11.0.1": version "11.0.1" resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-11.0.1.tgz#f542ec47810532a8a252127e6e105f487e0a6ea5" @@ -2637,6 +2657,11 @@ dependencies: "@types/node" "*" +"@types/har-format@*": + version "1.2.16" + resolved "https://registry.yarnpkg.com/@types/har-format/-/har-format-1.2.16.tgz#b71ede8681400cc08b3685f061c31e416cf94944" + integrity sha512-fluxdy7ryD3MV6h8pTfTYpy/xQzCFC7m89nOH9y94cNqJ1mDIDPut7MnRHI3F6qRmh/cT2fUjG1MLdCNb4hE9A== + "@types/http-cache-semantics@^4.0.2": version "4.0.4" resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz#b979ebad3919799c979b17c72621c0bc0a31c6c4"