chrome ARC-Welder javascript console plugin not defined
Asked Answered
C

2

8

I installed ARC_Welder to test run my android apps. App runs , but I was trying to get logs. I read this article : https://developer.chrome.com/apps/getstarted_arc .

Tried running -- plugin.shell('adbd') in JavaScript console (chrome://inspect/#apps) .

But i'm getting this error : Uncaught ReferenceError: plugin is not defined

Same thing happened when tried running : plugin.shell('logcat');

I'm not a chrome javascript developer. please help me understand where i am wrong..

Chipmunk answered 8/4, 2015 at 15:44 Comment(2)
Which OS are you running (Windows/Mac/Linux) and which version of Chrome are you using.Egypt
Try restarting Chrome. I ran into that condition, and a full restart of Chrome fixed it.Greeley
F
7

I just had the same issue, the instructions on the page you mentioned are correct, but not very clear.

You should:

  1. Open your debug APK in ARC Welder and run it
  2. Open logcat in Android Studio, (or what ever tool you normally use to view logcat).
  3. Open Chrome and type "chrome://inspect/#apps" in the address bar
  4. Hopefully you see your App name listed, click the 'inspect' link for your app.
  5. In the Javascript Console that appears type "plugin.shell('adbd')" and press enter.
  6. Now go back to Android Studio and you should see a load of log messages in the logcat, filter by your app name and hopefully you are good to go.
Farrington answered 10/4, 2015 at 14:44 Comment(2)
I also found the same issue as @Commonsware Restarting everything was sometimes required to get plugin.shell('logcat'); to work, running it that way will show the log in the js console in Chrome, whereas doing it the way I suggested can be helpful in Android Studio (filtering out all the other noise in Android Studio is a pain though)Farrington
@MikeFosker, any idea why the network tab isn't showing all the traffic?Childs
M
1

Are you sure you opened your apps page by clicking the "inspect" link from the "chrome://inspect/#apps" page?

The error you see suggests that you are typing it into some javascript console that isn't for an app view. The "plugin" name is only defined for use by Chrome apps and extensions, and not arbitrary web pages.

Musca answered 9/4, 2015 at 0:48 Comment(1)
FWIW, I am rather sure that I was running into problems on the app's console, not the console for a random page. In at least one cast, I opened the inspect window for the app, tried using a plugin, and it worked, then closed and later re-opened the inspect window for the same app (and, IIRC, the same running app instance), and that's when plugin was not recognized. I have not yet come up with a reproducible scenario, though.Greeley

© 2022 - 2024 — McMap. All rights reserved.