Comments (5)
Honestly I haven't tried compiling to WASM either.
One thing I want to point out is that this library (and likewise fantoccini and other selenium/webdriver libraries) doesn't actually do any browser automation itself. Instead it issues HTTP requests/commands to a webdriver server (chromedriver/geckodriver etc) and it is the webdriver that actually takes care of launching another browser instance and interacting with it. Does that sound like what you're trying to do?
I'm wondering if it isn't easier to simply use javascript/WASM to control the browser you're currently running in, instead.
I guess that's where I'm still a little confused by what you're trying to do. To clarify, are you wanting to do web requests from a browser, to a local webdriver server (or I guess it could be remote if you wish), to then control a separate browser instance?
from thirtyfour.
You got it right ;)
I'm aware the webdriver server does the magic and the library is just a client. About the WASM/JS code controlling the current browser, unless I'm missing something one does not "just" control the current browser right? And for some of the stuff that I need to run(e.g. make a screen capture) it won't work to just let the Rust WASM code do things with the current document because this WASM plugin not only doesn't have DOM access(runs in a worker) but also doesn't know if it will be running in a browser or a server. Does it make sense? 😅
Anyway if I have time later enxt week I'll test the WASM compilation, doesn't seem that difficult maybe some parts of the code would need to be feature gated if they are doing things like accessing the file system.
from thirtyfour.
Ok yes that makes sense. Let me know how the WASM compilation goes
from thirtyfour.
@olanod you probably have to create a new HTTP request backend. The current default is reqwest
which most likely will not even compile to WASM. However, wasm-bindgen
or rather js-sys
provides access to the native JavaScript APIs for making HTTP requests so it should not be too hard to work around it that way. AFAIK the HTTP client is already abstracted away in thirtyfour
🙂
from thirtyfour.
Yes the http client is abstracted out and you can implement the relevant trait and supply your own.
I'm keen to see how far you get with this.
from thirtyfour.
Related Issues (20)
- so, how to get the text value of an element HOT 1
- Error while clicking element. HOT 4
- `#shadow-root` doesn't work on Firefox with geckodriver HOT 1
- Connection refused when using containers HOT 4
- How to use selenium-manager in my code? HOT 2
- thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code: received unknown error (no such frame) for NOT_FOUND status code' HOT 4
- How can I set the user-agent for Chromedriver? HOT 3
- Is there a way to use wait_until or something like it to way for a specific ID to be available ? HOT 2
- wait until element to disappear HOT 6
- Chrome Options example erroring HOT 2
- Does `query` work on child elements? HOT 3
- Cannot interact with WebElement HOT 1
- How to trigger onchange event without submitting the form? HOT 2
- How to set PageLoadStrategy::None in DesiredCapabilities::chrome()? HOT 1
- Running the Test without Existing Browser (HtmlUnitDriver) HOT 1
- Add cdp type from auto_generate_cdp crate HOT 2
- How to handle file picker? HOT 4
- How to capture the Chromium's requests and responses traffic using thirtyfour HOT 5
- Maintenance Status
- Device Farm incompatibility - with workaround
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thirtyfour.