Code Monkey home page Code Monkey logo

Comments (4)

asticode avatar asticode commented on June 21, 2024

Are you using astilectron in go-astilectron?

from astilectron.

nanu-c avatar nanu-c commented on June 21, 2024

Yes, in go-astilectron. The function in js that is triggering the navigation event is a callback function from google recaptcha. It's not possible for me to overwrite the captacha rendering.

An example js snippet would be:

function execute() {
	window.location ="appidentifier://token"
}
setTimeout(execute, 1000);

And this should go to window.location='http://" + config.ServerHost + ":" + config.ServerPort + "/?token=" + e.URLNew

but maybe i should open this issue in go-astilectron.

from astilectron.

asticode avatar asticode commented on June 21, 2024

This is a tricky one, since right now there's no way in js astilectron to send a message and wait for its response before continuing js execution. Which is what would be needed:

  • in will-navigate, call go-astilectron to see whether we need to redirect this request
  • based on go-astilectron, call event.preventDefault() and update window.location manually if we need a redirection

I don't have a proper answer for you right now, I'd have to think about it.

from astilectron.

nanu-c avatar nanu-c commented on June 21, 2024

I found another way, because i needed to circumvent the situation. I replace the original js with my own js that I have sideloaded. Then i reinitialize the captcha and finally i have the captcha on the correct domain and i can get the token and everyone is happy. Not a good solution in my eyes because it shows how sensible electron is, because i can do whatever i want and break sandboxing and browser security.

from astilectron.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.