Skip to content

Commit

Permalink
use origin as base of worker location (#1175) (#1208)
Browse files Browse the repository at this point in the history
  • Loading branch information
domdir authored and mergify[bot] committed May 14, 2020
1 parent 34e523a commit e9c24ef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions yew/src/agent.rs
Expand Up @@ -1014,9 +1014,9 @@ where

#[cfg(feature = "web_sys")]
fn worker_new(name_of_resource: &str, is_module: bool) -> Worker {
let href = utils::document().location().unwrap().href().unwrap();
let script_url = format!("{}{}", href, name_of_resource);
let wasm_url = format!("{}{}", href, name_of_resource.replace(".js", "_bg.wasm"));
let origin = utils::origin().unwrap();
let script_url = format!("{}/{}", origin, name_of_resource);
let wasm_url = format!("{}/{}", origin, name_of_resource.replace(".js", "_bg.wasm"));
let array = Array::new();
array.push(
&format!(
Expand Down

0 comments on commit e9c24ef

Please sign in to comment.