|
|
|
@ -70,6 +70,7 @@ pub fn walk_and_embed_assets(
|
|
|
|
|
opt_no_images: bool,
|
|
|
|
|
opt_user_agent: &str,
|
|
|
|
|
opt_silent: bool,
|
|
|
|
|
opt_insecure: bool,
|
|
|
|
|
) {
|
|
|
|
|
match node.data {
|
|
|
|
|
NodeData::Document => {
|
|
|
|
@ -81,6 +82,7 @@ pub fn walk_and_embed_assets(
|
|
|
|
|
opt_no_images,
|
|
|
|
|
opt_user_agent,
|
|
|
|
|
opt_silent,
|
|
|
|
|
opt_insecure,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -133,7 +135,9 @@ pub fn walk_and_embed_assets(
|
|
|
|
|
"",
|
|
|
|
|
opt_user_agent,
|
|
|
|
|
opt_silent,
|
|
|
|
|
).unwrap_or(EMPTY_STRING.clone());
|
|
|
|
|
opt_insecure,
|
|
|
|
|
)
|
|
|
|
|
.unwrap_or(EMPTY_STRING.clone());
|
|
|
|
|
attr.value.clear();
|
|
|
|
|
attr.value.push_slice(favicon_datauri.as_str());
|
|
|
|
|
}
|
|
|
|
@ -153,7 +157,9 @@ pub fn walk_and_embed_assets(
|
|
|
|
|
"text/css",
|
|
|
|
|
opt_user_agent,
|
|
|
|
|
opt_silent,
|
|
|
|
|
).unwrap_or(EMPTY_STRING.clone());
|
|
|
|
|
opt_insecure,
|
|
|
|
|
)
|
|
|
|
|
.unwrap_or(EMPTY_STRING.clone());
|
|
|
|
|
attr.value.clear();
|
|
|
|
|
attr.value.push_slice(css_datauri.as_str());
|
|
|
|
|
}
|
|
|
|
@ -190,7 +196,9 @@ pub fn walk_and_embed_assets(
|
|
|
|
|
"",
|
|
|
|
|
opt_user_agent,
|
|
|
|
|
opt_silent,
|
|
|
|
|
).unwrap_or(EMPTY_STRING.clone());
|
|
|
|
|
opt_insecure,
|
|
|
|
|
)
|
|
|
|
|
.unwrap_or(EMPTY_STRING.clone());
|
|
|
|
|
attr.value.clear();
|
|
|
|
|
attr.value.push_slice(img_datauri.as_str());
|
|
|
|
|
}
|
|
|
|
@ -216,7 +224,9 @@ pub fn walk_and_embed_assets(
|
|
|
|
|
"",
|
|
|
|
|
opt_user_agent,
|
|
|
|
|
opt_silent,
|
|
|
|
|
).unwrap_or(EMPTY_STRING.clone());
|
|
|
|
|
opt_insecure,
|
|
|
|
|
)
|
|
|
|
|
.unwrap_or(EMPTY_STRING.clone());
|
|
|
|
|
attr.value.clear();
|
|
|
|
|
attr.value.push_slice(source_datauri.as_str());
|
|
|
|
|
}
|
|
|
|
@ -262,7 +272,9 @@ pub fn walk_and_embed_assets(
|
|
|
|
|
"application/javascript",
|
|
|
|
|
opt_user_agent,
|
|
|
|
|
opt_silent,
|
|
|
|
|
).unwrap_or(EMPTY_STRING.clone());
|
|
|
|
|
opt_insecure,
|
|
|
|
|
)
|
|
|
|
|
.unwrap_or(EMPTY_STRING.clone());
|
|
|
|
|
attr.value.clear();
|
|
|
|
|
attr.value.push_slice(js_datauri.as_str());
|
|
|
|
|
}
|
|
|
|
@ -295,7 +307,9 @@ pub fn walk_and_embed_assets(
|
|
|
|
|
"text/html",
|
|
|
|
|
opt_user_agent,
|
|
|
|
|
opt_silent,
|
|
|
|
|
).unwrap_or(EMPTY_STRING.clone());
|
|
|
|
|
opt_insecure,
|
|
|
|
|
)
|
|
|
|
|
.unwrap_or(EMPTY_STRING.clone());
|
|
|
|
|
let dom = html_to_dom(&iframe_data);
|
|
|
|
|
walk_and_embed_assets(
|
|
|
|
|
&src_full_url,
|
|
|
|
@ -304,6 +318,7 @@ pub fn walk_and_embed_assets(
|
|
|
|
|
opt_no_images,
|
|
|
|
|
opt_user_agent,
|
|
|
|
|
opt_silent,
|
|
|
|
|
opt_insecure,
|
|
|
|
|
);
|
|
|
|
|
let mut buf: Vec<u8> = Vec::new();
|
|
|
|
|
serialize(&mut buf, &dom.document, SerializeOpts::default()).unwrap();
|
|
|
|
@ -334,6 +349,7 @@ pub fn walk_and_embed_assets(
|
|
|
|
|
opt_no_images,
|
|
|
|
|
opt_user_agent,
|
|
|
|
|
opt_silent,
|
|
|
|
|
opt_insecure,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|