Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

browser automation like puppeteer #452

Open
ceddybi opened this issue Feb 29, 2024 · 3 comments
Open

browser automation like puppeteer #452

ceddybi opened this issue Feb 29, 2024 · 3 comments

Comments

@ceddybi
Copy link

ceddybi commented Feb 29, 2024

is it possible to implement a solution that works like puppeteer, mainly;

  • to download entire website content,
  • to interact with the dom, data input, intercept requests e.t.c ...
@tladesignz
Copy link
Contributor

is it possible to implement a solution that works like puppeteer, mainly;

  • to download entire website content,

For later viewing?
I guess, you would do that with URLSession plus some not so small logic to follow all referenced resources and links, not WKWebView.

  • to interact with the dom, data input, intercept requests e.t.c ...

One can load their own JavaScript into a given Website context. You can mangle the DOM with that and inject form values and the like. Requests to resources can at least be denied, not sure about replacing them.

But why would you want to do that on iOS? Seems cumbersome, compared to doinng this on some Linux server.

If you're just looking for an ad filter, there's better solutions

@ceddybi
Copy link
Author

ceddybi commented Feb 29, 2024

Thank you @tladesignz

I guess, you would do that with URLSession plus some not so small logic to follow all referenced resources and links, not WKWebView.

How would you archive something similar to chrome, where you right click > "Save as" > Webpage + Assets (images / js scripts / css)

One can load their own JavaScript into a given Website context. You can mangle the DOM with that and inject form values and the like.

This is all i need

But why would you want to do that on iOS? Seems cumbersome, compared to doinng this on some Linux server.

Well, this app can run on Mac, so it'd be easier than running it from iOS

@tladesignz
Copy link
Contributor

I guess, you would do that with URLSession plus some not so small logic to follow all referenced resources and links, not WKWebView.

How would you archive something similar to chrome, where you right click > "Save as" > Webpage + Assets (images / js scripts / css)

That'll be a few days of serious coding. +X for catching all the edge cases. You wouldn't need Onion Browser for that, that would just be a distraction.

One can load their own JavaScript into a given Website context. You can mangle the DOM with that and inject form values and the like.

This is all i need

But why would you want to do that on iOS? Seems cumbersome, compared to doinng this on some Linux server.

Well, this app can run on Mac, so it'd be easier than running it from iOS

On Mac? In a simulator. Well. Or as iPad-app-running-on-macOS. Well, well. What you're up to, sounds like you would be better of with a fresh project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants