diff --git a/README.md b/README.md index b920082..c8da3f3 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ npm version -Scramjet is an experimental inteception based web proxy that aims to be the successor to Ultraviolet. It is designed with security, developer friendlyness, and performance in mind. Scramjet strives to have a clean, organized codebase to improve maintainability. Scramjet is made to evade internet censorship and bypass arbitrary web browser restrictions. +Scramjet is an experimental interception based web proxy that aims to be the successor to Ultraviolet. It is designed with security, developer friendliness, and performance in mind. Scramjet strives to have a clean, organized codebase to improve maintainability. Scramjet is made to evade internet censorship and bypass arbitrary web browser restrictions. ## Supported Sites @@ -35,7 +35,7 @@ Some of the popular websites that Scramjet supports include: #### Building - Clone the repository with `git clone --recursive https://github.com/MercuryWorkshop/scramjet` -- Then, install your dependencies with `pnpm i` +- Then, install the dependencies with `pnpm i` - After, build the rewriter with `pnpm rewriter:build` - Finally, build Scramjet with `pnpm build` diff --git a/rewriter/src/lib.rs b/rewriter/src/lib.rs index 0621e85..da833ec 100644 --- a/rewriter/src/lib.rs +++ b/rewriter/src/lib.rs @@ -138,7 +138,7 @@ fn create_rewriter_output( #[wasm_bindgen] pub fn rewrite_js( - js: &str, + js: String, url: &str, script_url: String, scramjet: &Object, @@ -149,15 +149,15 @@ pub fn rewrite_js( } let before = Instant::now(); - let out = rewrite(js, Url::from_str(url)?, get_config(scramjet, url)?)?; + let out = rewrite(&js, Url::from_str(url)?, get_config(scramjet, url)?)?; let after = Instant::now(); - create_rewriter_output(out, script_url, js.to_string(), after - before) + create_rewriter_output(out, script_url, js, after - before) } #[wasm_bindgen] pub fn rewrite_js_from_arraybuffer( - js: &[u8], + js: Vec, url: &str, script_url: String, scramjet: &Object, @@ -168,11 +168,11 @@ pub fn rewrite_js_from_arraybuffer( } // we know that this is a valid utf-8 string - let js = unsafe { std::str::from_utf8_unchecked(js) }; + let js = unsafe { String::from_utf8_unchecked(js) }; let before = Instant::now(); - let out = rewrite(js, Url::from_str(url)?, get_config(scramjet, url)?)?; + let out = rewrite(&js, Url::from_str(url)?, get_config(scramjet, url)?)?; let after = Instant::now(); - create_rewriter_output(out, script_url, js.to_string(), after - before) + create_rewriter_output(out, script_url, js, after - before) }