Skip to content

Commit

Permalink
use origin as base of worker location (yewstack#1175)
Browse files Browse the repository at this point in the history
  • Loading branch information
domdir committed May 11, 2020
1 parent b13605e commit ec98e46
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions yew/src/agent/worker/mod.rs
Expand Up @@ -86,9 +86,9 @@ fn send_to_remote<AGN: Agent>(

#[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 ec98e46

Please sign in to comment.