MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / Plugin

Class Plugin

src/plugins/browser/android/com/foxdebug/browser/Plugin.java:11–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9import org.json.JSONObject;
10
11public 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}

Callers 3

pluginFunction · 0.85
handleClickFunction · 0.85
HandleIntentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected