File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 8888#
8989` ;
9090
91+ let sharedQuery ;
92+ const hashArgs = new URLSearchParams ( window . location . hash . substring ( 1 ) ) ;
93+ if ( hashArgs . has ( 'query' ) ) {
94+ sharedQuery = hashArgs . get ( 'query' ) ;
95+ // reset url to not motivate copying of stale URL
96+ hashArgs . delete ( 'query' ) ;
97+ console . log ( "args size" , hashArgs . size )
98+ let remainingHash = "" ;
99+ if ( hashArgs . size !== 0 ) {
100+ remainingHash = `#${ hashArgs . toString ( ) } ` ;
101+ }
102+ history . pushState ( "" , document . title ,
103+ window . location . pathname + window . location . search + remainingHash
104+ ) ;
105+ }
106+
91107 const fetchURL = window . location . href ;
92108
93109 function httpUrlToWebSockeUrl ( url ) {
123139 defaultEditorToolsVisibility : true ,
124140 plugins : [ explorerPlugin ] ,
125141 inputValueDeprecation : true ,
142+ defaultQuery : EXAMPLE_QUERY ,
143+ query : sharedQuery ,
126144 } ) ,
127145 ) ;
128146 </ script >
You can’t perform that action at this time.
0 commit comments