| 9 | import org.json.JSONObject; |
| 10 | |
| 11 | public class Plugin extends CordovaPlugin { |
| 12 | |
| 13 | @Override |
| 14 | public boolean execute( |
| 15 | String action, |
| 16 | JSONArray args, |
| 17 | CallbackContext callbackContext |
| 18 | ) throws JSONException { |
| 19 | if (action.equals("open")) { |
| 20 | String url = args.getString(0); |
| 21 | JSONObject theme = args.getJSONObject(1); |
| 22 | boolean onlyConsole = args.optBoolean(2, false); |
| 23 | String themeString = theme.toString(); |
| 24 | Intent intent = new Intent(cordova.getActivity(), BrowserActivity.class); |
| 25 | |
| 26 | intent.putExtra("url", url); |
| 27 | intent.putExtra("theme", themeString); |
| 28 | intent.putExtra("onlyConsole", onlyConsole); |
| 29 | cordova.getActivity().startActivity(intent); |
| 30 | callbackContext.success("Opened browser"); |
| 31 | return true; |
| 32 | } |
| 33 | return false; |
| 34 | } |
| 35 | } |
no outgoing calls
no test coverage detected