Skip to content

Commit

Permalink
Dev/jwunderl/ports to 10 2 (#10205)
Browse files Browse the repository at this point in the history
* add option to pin offline-app page to a specific version (#10195)

* electron now giving permission for user media request (#10204)
  • Loading branch information
jwunderl authored Sep 26, 2024
1 parent 2fd70b7 commit b03f81e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
14 changes: 14 additions & 0 deletions docfiles/offline-app-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,20 @@
window.pxtTickEvent("offlineapp.download", { "target": "@targetid@", "platform": "mac64" });
}
$(function () {
try {
const urlParams = new URLSearchParams(window.location.search);
const versionOverride = urlParams.get("version") || urlParams.get("v");

if (versionOverride && /^v\d+\.\d+\.\d+$/i.test(versionOverride)) {
updateDownloadLinks(versionOverride);
showAgree();
hideLoader();
return;
}
} catch (e) {
console.warn("Could not parse search string", e);
}

$.getJSON("https://makecode.com/api/config/@targetid@/targetconfig")
.then(function (data) {
hideLoader();
Expand Down
3 changes: 1 addition & 2 deletions webapp/src/greenscreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ function isMediaDevicesSupported(): boolean {
return typeof navigator !== undefined
&& !!navigator.mediaDevices
&& !!navigator.mediaDevices.enumerateDevices
&& !!navigator.mediaDevices.getUserMedia
&& !pxt.BrowserUtils.isElectron();
&& !!navigator.mediaDevices.getUserMedia;
}

export class WebCam extends data.Component<WebCamProps, WebCamState> {
Expand Down

0 comments on commit b03f81e

Please sign in to comment.