File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -44,14 +44,18 @@ pub(crate) fn init(config: &crate::Config) -> UnboundedReceiver<HotReloadMsg> {
4444fn make_ws ( tx : UnboundedSender < HotReloadMsg > , poll_interval : i32 , reload : bool ) {
4545 // Get the location of the devserver, using the current location plus the /_dioxus path
4646 // The idea here being that the devserver is always located on the /_dioxus behind a proxy
47- let location = web_sys:: window ( ) . unwrap ( ) . location ( ) ;
47+ let mut location =
48+ web_sys:: Url :: new ( & web_sys:: window ( ) . unwrap ( ) . location ( ) . href ( ) . unwrap ( ) ) . unwrap ( ) ;
49+ if location. protocol ( ) == "chrome-extension:" || location. protocol ( ) == "moz-extension:" {
50+ location = web_sys:: Url :: new ( "http://localhost:8080" ) . unwrap ( ) ;
51+ }
4852 let url = format ! (
4953 "{protocol}//{host}/_dioxus?build_id={build_id}" ,
50- protocol = match location. protocol( ) . unwrap ( ) {
54+ protocol = match location. protocol( ) {
5155 prot if prot == "https:" => "wss:" ,
5256 _ => "ws:" ,
5357 } ,
54- host = location. host( ) . unwrap ( ) ,
58+ host = location. host( ) ,
5559 build_id = dioxus_cli_config:: build_id( ) ,
5660 ) ;
5761
You can’t perform that action at this time.
0 commit comments