No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Testing a cordova plugin in browser

    Help
    2
    2
    1446
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      coxy121 last edited by coxy121

      Is it possible to test Cordova plugins used in a Quasar app in the browser?

      I am using the plugin cordova-plugin-camera the functionality is working when I run in the IOS simulator, but it is hard to debug this way and is a very slow
      development process.

      I have read that you should be able to use the Cordova platform browser to test, but when trying this method i receive the error:

      Uncaught TypeError: Cannot read property 'getPicture' of undefined

      The code in my function is:

      navigator.camera.getPicture(this.cameraSuccess, this.cameraError, {
       destinationType: Camera.DestinationType.DATA_URL,
       sourceType: Camera.PictureSourceType.PHOTOLIBRARY 
      })
      

      It appears that navigator.camera is not defined, is there any way to resolve this?

      Additionally when using quasar dev to work I get the following warnings/error:

      http://eslint.org/docs/rules/no-undef 'Camera' is not defined

      Is there anyway to resolve this warning?

      1 Reply Last reply Reply Quote 0
      • a47ae
        a47ae last edited by

        I don’t know about the first issue, but to work around the ESLint issue, you can add Camera to the globals section in your .eslintrc.js

        1 Reply Last reply Reply Quote 1
        • First post
          Last post