pub struct WebSource { /* private fields */ }Expand description
Web content source that fetches JavaScript, source maps, and WASM from URLs.
URLs ending in .wasm are treated as binary and have strings extracted.
URLs ending in .map are treated as source maps and have sourcesContent
entries split into individual chunks. Everything else is treated as
JavaScript text.
Implementations§
Source§impl WebSource
impl WebSource
Sourcepub fn new(urls: Vec<String>) -> Self
pub fn new(urls: Vec<String>) -> Self
Create a web source from a list of URLs to scan.
§Examples
use keyhog_sources::WebSource;
use keyhog_core::Source;
let source = WebSource::new(vec!["https://example.com/app.js".into()]);
assert_eq!(source.name(), "web");Sourcepub fn from_url(url: &str) -> Self
pub fn from_url(url: &str) -> Self
Create a web source from a single URL.
§Examples
use keyhog_sources::WebSource;
use keyhog_core::Source;
let source = WebSource::from_url("https://example.com/app.js");
assert_eq!(source.name(), "web");Sourcepub fn with_http_config(self, http: HttpClientConfig) -> Self
pub fn with_http_config(self, http: HttpClientConfig) -> Self
Override the default HTTP policy (proxy, insecure-TLS,
timeout). Construct from HttpClientConfig directly when the
caller already has CLI-derived flags to thread through.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WebSource
impl RefUnwindSafe for WebSource
impl Send for WebSource
impl Sync for WebSource
impl Unpin for WebSource
impl UnsafeUnpin for WebSource
impl UnwindSafe for WebSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more