diff --git a/localtypings/pxtarget.d.ts b/localtypings/pxtarget.d.ts index 2fb9020765c6..6e91644dbf4d 100644 --- a/localtypings/pxtarget.d.ts +++ b/localtypings/pxtarget.d.ts @@ -493,6 +493,7 @@ declare namespace pxt { cloudProfileIcon?: string; // the file path for added imagery on smaller profile dialogs timeMachine?: boolean; // Save/restore old versions of a project experiment blocklySoundVolume?: number; // A number between 0 and 1 that sets the volume for blockly sounds (e.g. connect, disconnect, click) + timeMachineQueryParams?: string[]; // An array of query params to pass to timemachine iframe embed } interface DownloadDialogTheme { diff --git a/webapp/src/timeMachine.tsx b/webapp/src/timeMachine.tsx index 37a449439bcc..6fd63d466611 100644 --- a/webapp/src/timeMachine.tsx +++ b/webapp/src/timeMachine.tsx @@ -214,7 +214,21 @@ export const TimeMachine = (props: TimeMachineProps) => { onProjectCopy(files, editorVersion, selected?.timestamp) }, [selected, onProjectCopy]); - const url = `${window.location.origin + window.location.pathname}?timeMachine=1&controller=1&skillsMap=1&noproject=1&nocookiebanner=1`; + let queryParams = [ + "timeMachine", + "controller", + "skillsMap", + "noproject", + "nocookiebanner" + ]; + + if (pxt.appTarget?.appTheme.timeMachineQueryParams) { + queryParams = queryParams.concat(pxt.appTarget.appTheme.timeMachineQueryParams); + } + + const argString = queryParams.map(p => p.indexOf("=") === -1 ? `${p}=1` : p).join("&"); + + const url = `${window.location.origin + window.location.pathname}?${argString}`; return createPortal(