File tree Expand file tree Collapse file tree 4 files changed +8
-7
lines changed Expand file tree Collapse file tree 4 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { HistoryState } from "./History";
77import { focusOmnibox } from "./components/UrlInput" ;
88
99import * as tldts from "tldts" ;
10- import { scramjet } from "./main" ;
10+ import { isPuter , scramjet } from "./main" ;
1111import { animateDownloadFly } from "./components/Omnibox" ;
1212import { showDownloadsPopup } from "./components/DownloadsPopup" ;
1313export const pushTab = createDelegate < Tab > ( ) ;
@@ -220,10 +220,7 @@ export class Browser extends StatefulClass {
220220
221221 destroyTab ( tab : Tab ) {
222222 this . tabs = this . tabs . filter ( ( t ) => t !== tab ) ;
223- if (
224- this . tabs . length === 0 &&
225- location . ancestorOrigins [ 0 ] === "https://puter.com"
226- ) {
223+ if ( this . tabs . length === 0 && isPuter ) {
227224 puter . exit ( ) ;
228225 }
229226
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { Checkbox } from "./Checkbox";
1010import { Icon } from "./Icon" ;
1111import type { IconifyIcon } from "@iconify/types" ;
1212import { emToPx } from "../utils" ;
13+ import { isPuter } from "../main" ;
1314
1415export const closeMenu = createDelegate < void > ( ) ;
1516
@@ -206,7 +207,7 @@ export function createMenu(
206207 y : number ,
207208 items : MenuItem [ ]
208209) : DLElement < typeof Menu > {
209- if ( location . ancestorOrigins [ 0 ] === "https://puter.com" ) {
210+ if ( isPuter ) {
210211 puter . ui . contextMenu ( {
211212 items : items . map ( ( i ) =>
212213 i == "-"
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import iconInfo from "@ktibow/iconset-ion/information-circle-outline";
2020import iconSettings from "@ktibow/iconset-ion/settings-outline" ;
2121import { showDownloadsPopup } from "./DownloadsPopup" ;
2222import type { HistoryState } from "../History" ;
23+ import { isPuter } from "../main" ;
2324
2425export const animateDownloadFly = createDelegate < void > ( ) ;
2526
@@ -263,7 +264,7 @@ export const Omnibox: Component<{
263264 } ,
264265 icon : iconSettings ,
265266 } ,
266- ...( location . ancestorOrigins [ 0 ] === "https://puter.com"
267+ ...( isPuter
267268 ? [
268269 {
269270 label : "Exit" ,
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ import { css, type Component } from "dreamland/core";
1212
1313const { ScramjetController } = $scramjetLoadController ( ) ;
1414
15+ export const isPuter = ! import . meta. env . VITE_LOCAL && puter . env == "app" ;
16+
1517const scramjetcfg : Partial < ScramjetInitConfig > = {
1618 wisp : "ws://localhost:1337/" ,
1719 files : {
You can’t perform that action at this time.
0 commit comments