File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed
Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -615,15 +615,23 @@ class EditorWindow extends ProjectRunningWindow {
615615 }
616616
617617 handleWindowOpen ( details ) {
618+ const url = new URL ( details . url ) ;
619+ const params = new URLSearchParams ( url . search ) ;
620+
618621 // Open extension sample projects in-app
619- const extensionSamplesMatch = details . url . match (
620- / ^ t w - e d i t o r : \/ \/ \. \/ g u i \/ e d i t o r \? p r o j e c t _ u r l = ( h t t p s : \/ \/ e x t e n s i o n s \. t u r b o w a r p \. o r g \/ s a m p l e s \/ .+ \. s b 3 ) $ /
621- ) ;
622- if ( extensionSamplesMatch ) {
623- EditorWindow . openFiles ( [ extensionSamplesMatch [ 1 ] ] , false , '' ) ;
624- return {
625- action : 'deny'
626- } ;
622+ if (
623+ url . protocol === 'tw-editor:' &&
624+ url . host === '.' &&
625+ params . has ( 'project_url' )
626+ ) {
627+ const projectUrl = params . get ( 'project_url' ) ;
628+ const parsedFile = parseOpenedFile ( projectUrl , null ) ;
629+ if ( parsedFile . type === TYPE_SAMPLE ) {
630+ new EditorWindow ( parsedFile , null ) ;
631+ return {
632+ action : 'deny'
633+ } ;
634+ }
627635 }
628636
629637 // Open extension documentation in-app
You can’t perform that action at this time.
0 commit comments