File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ export class Tab extends StatefulClass {
2020 history : History ;
2121
2222 constructor ( public url : URL = new URL ( "puter://newtab" ) ) {
23- super ( createState ( new Object ( Tab . prototype ) ) ) ;
23+ super ( createState ( Object . create ( Tab . prototype ) ) ) ;
24+
2425 this . id = id ++ ;
2526
2627 this . title = null ;
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ Spacer.css = `
2222
2323export const UrlInput : Component <
2424 {
25- tabUrl : string ;
25+ tabUrl : URL ;
2626 navigate : ( url : string ) => void ;
2727 } ,
2828 {
@@ -76,7 +76,7 @@ export const UrlInput: Component<
7676 browser . unfocusframes = false ;
7777 e . stopPropagation ( ) ;
7878 } ) ;
79- this . value = this . tabUrl ;
79+ this . value = this . tabUrl . href ;
8080 this . input . focus ( ) ;
8181 this . input . select ( ) ;
8282 e . stopPropagation ( ) ;
@@ -149,12 +149,12 @@ export const UrlInput: Component<
149149 . map ( ( a ) => ! a )
150150 . andThen (
151151 < span class = "inactiveurl" >
152- { use ( this . tabUrl ) . map ( ( v ) =>
153- v && URL . canParse ( v )
154- ? new URL ( v ) . hostname +
155- new URL ( v ) . pathname +
156- new URL ( v ) . search
157- : ""
152+ { use ( this . tabUrl ) . map (
153+ ( v ) =>
154+ ( v . protocol === "puter:" ? v . protocol : "" ) +
155+ v . host +
156+ v . pathname +
157+ v . search
158158 ) }
159159 </ span >
160160 ) }
@@ -231,7 +231,7 @@ UrlInput.css = `
231231` ;
232232
233233export const Omnibox : Component < {
234- tabUrl : string ;
234+ tabUrl : URL ;
235235 navigate : ( url : string ) => void ;
236236 goBack : ( ) => void ;
237237 goForwards : ( ) => void ;
Original file line number Diff line number Diff line change 11import type { Component } from "dreamland/core" ;
2- import type { Tab } from "./TabStrip" ;
32import { browser } from "../main" ;
43import { popTab , pushTab } from "../browser" ;
4+ import type { Tab } from "../Tab" ;
55
66export const Shell : Component < {
77 tabs : Tab [ ] ;
You can’t perform that action at this time.
0 commit comments