Code Monkey home page Code Monkey logo

Comments (5)

mircoc avatar mircoc commented on August 14, 2024

Hello,
i had an issue on my app with failing ajax calls, because of too much of these HEAD requests, the browser was blocking my ajax call.

So i changed the cordova communication type to iframe_nav:

var exec = cordova.require('cordova/exec');
exec.setJsToNativeBridgeMode(exec.jsToNativeModes.IFRAME_NAV);

The bridge mode is set by hostedwebapp when it inject cordova in a page:
https://github.com/manifoldjs/ManifoldCordova/blob/master/www/hostedapp-bridge.js#L45

from manifoldcordova.

mattwoberts avatar mattwoberts commented on August 14, 2024

Thanks for that @mircoc, that's really helpful.

So is this something that we should change - do we need to create a pull request with this change? I'm not sure what the implications will be switching it to IFRAME_NAV - are there other things to be aware of? Does setting it to IFRAME_NAV stop it from making these HEAD requests?

It seems a bit weird to me that we're making all these eroneous requests, and something we should get sorted out in this project?

Cheers

from manifoldcordova.

boyofgreen avatar boyofgreen commented on August 14, 2024

Thanks @mircoc and @mattwoberts as always :) We are going to start another release after build and we'll look at this. I'm not the cordova Expert so I don't know what the tradeoff is, but we'll research. Any other feedback is helpful.

from manifoldcordova.

mattwoberts avatar mattwoberts commented on August 14, 2024

I'll be very keen to see what happens with this.

The consensus on a little googling is that IFRAME_NAV is a little faster and should get round this problem, but it might (or might not, depending on what jira issues you read) have issues of it's own:

https://github.com/LonnyGomes/cordova-ios/blob/master/guides/Changing%20the%20JavaScript%20to%20Native%20Bridge%20Mode.md

I'm not going to switch to IFRAME_NAV for now, I'm wondering if I should just create a route for that URL on the server to at least stop it from cluttering up my logs.

from manifoldcordova.

boyofgreen avatar boyofgreen commented on August 14, 2024

we'll start with some research on this.

from manifoldcordova.

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.