cordova-browser icon indicating copy to clipboard operation
cordova-browser copied to clipboard

PACKAGE_NAME wrong in browser.json

Open kluns opened this issue 5 years ago • 1 comments

Bug Report

Problem

If a project uses android platform and browser platform, and the android-versionCode attribute is set in config.xml, when a plugin is added the value for PACKAGE_NAME is set wrong in browser.json.

What is expected to happen?

PACKAGE_NAME should be set to the widget id attribute value from config.xml

What does actually happen?

PACKAGE_NAME is set to 'io.cordova.hellocordova'

Information

In browser_handler.js the regular expression in widget_id_regex does not work if config.xml has an attribute between the "<widget" tag name and the "id=" attribute.

The current regular expression works for:

<widget id="com.myorg.myapp"

but not for:

<widget android-versionCode="01020304" id="com.myorg.myapp"

Command or Code

The regular expression in browser_handler.js needs to be changed to something like /(?:<widget\b.+\bid=['"])(\S+)(?:['"])/ to properly find the id attribute.

Environment, Platform, Device

browser platform

Version information

6.0.0

Checklist

  • [x ] I searched for existing GitHub issues
  • [x ] I updated all Cordova tooling to most recent version
  • [ x] I included all the necessary information above

kluns avatar Apr 27 '20 23:04 kluns

I'd like to work on this issue

dotarjun avatar May 31 '23 06:05 dotarjun