Service-worker.js not available in the for debugging in the chrome dev tools - android-webview

I understand service-worker runs as a separate thread parallel to the main thread.
I have an android app that runs Webview. My app is in react and i use workbox strategies for caching.
Service worker updates everytime I do a new build. However the source file of service-worker.js is not available in the chrome dev tools for me to debug.
Any idea how i can get the file there so that i can put breakpoints and debug ?
PS: just few days before i could get the file for debugging the dev tools. I am not sure what has changed. I havent changed any settings the the browser.

I'm having the exact same problem with the same symptoms and timeframe. I tried everything I can think of and can no longer get remote debugging of a service worker running in an Android WebView to work.
Like you I am sure it was working in mid-February and stopped working in the last few weeks.
I submitted a bug to Google which you can find here.
I think we can only hope it will be fixed in an upcoming release of Chrome.

You can inspect your extension's service worker but it's tricky, I don't know why Chrome doesn't show the service worker in the default chrome extension devtools.
here is how you can do it:
open chrome://serviceworker-internals/?devtools
find your extension there, there is a textarea that shows console logs, every console log will show the extension path in chrome e.g.
Console: {"lineNumber":688,"message":"[crx-helper] connection error","message_level":3,"sourceIdentifier":3,"sourceURL":"chrome-extension://aobpjedackhiamobjolncblfckdgfjbk/background.bundle.js"}
get that sourceUrl chrome-extension://aobpjedackhiamobjolncblfckdgfjbk/background.bundle.js yours will have a different id, which you can also see in chrome://extensions
paste that path in a new tab and open devtools (screenshot).

Related

only one launchdarkly client can exist at a time but another client already exists?, and other odd devtools warnings

When running our react web application both locally and in production, I am receiving the following errors and warnings in the Console. This error appears in the Console tab of Chrome Dev Tools when I am running our react web application both locally and in production.
The only warning or error that makes a modicum of sense is the youtube.com error as we have a link to a YouTube video on our home page, and perhaps we are not properly displaying the video.
I am at a complete loss for the rest of these warnings/errors and how to resolve them. We do not use LaunchDarklyClient in our web application at all. These DevTools failed to load source map:... warnings don't provide any context, and the links lead to no where.
Notably, when I run our website in incognito mode, the LaunchDarklyClient error goes away, as do the DevTools failed to load... warnings. Does that mean these warnings/errors are potentially due to some chrome extensions I am using, or something else related to my local chrome?
I did some testing by toggling extensions on and off:
adblock plus 3.16 is responsible for DevTools failed to load source map:... warnings
compose AI 1.0.0-rc1 is responsible for LaunchDarklyClient errors
unrecognized feature: web-share is not related to any of my extensions (still getting this warning when toggling all extensions off)
Still not sure if there's a way to hide or remove these warnings/errors other than to disable these chrome extensions.

Troubleshoot Android 4.3 webview within an app that requires up-to-date Google Play services

I need to troubleshoot an issue happening in a webview running within my app. This issue only occurs on Android versions lower or equal to 4.3. My app requires an up to date version of Google Play services.
In order to troubleshoot my webview, I usually can run my app under the Android Emulator (with the latest version of Android), then connect to the web view via Chrome (using chrome://inspect) - the web view appears in Chrome and I'm able to browse the DOM and debug.
To run the app under 4.3, I've created (under AVD) a new device from an existing device definition,
then picked the target Google APIs (Google Inc.) - API Level 18. I've then installed my app, but when trying to run it, I get the error message "This app won't run unless you update Google Play services.". There's an "Update" button on the previous dialog, but nothing happen when clicking on it.
I then tried to debug my issue using Genymotion. I've created a device under 4.3, followed these instructions to flash my device with the latest Google Play services and installed my app. I can now run the app and reproduce the issue within this simulated environment.
The trick now is to be able to connect to the web view from my local Chrome browser. I've enabled remote debugging as described here. Now my device appears in Chrome, but the web view is not showing up in the inspector. Similarly, if I open a new tab under the native browser, it won't show up in the remote inspector. If I open a new tab under Android Chrome though, I can see it showing up under my remote Chrome inspector.
I can see two way moving forward and successfully accessing to the DOM of my webview:
Fixing the "Update" issue under the Android Emulator running 4.3
Or
Connecting to my web view from my Chrome inspector while running the app under Genymotion
Any idea on how to solve one of these two problems?
I have been using weinre for sometimes. it's a pretty good tool to debug webview for android 4.3 and lower. It provides almost same interface as chrome debugger.
All you need to do are:
Install weinre
sudo npm -g install weinre
Client side:
Insert the following code to your webpage <head> section.
Note: it's better to put it at end of <head> section, otherwise there will be some strange errors and debugger won't show up.
<script src="http://<your server ip here>:8081/target/target-script-min.js"></script>
Server side
weinre --boundHost -all- --httpPort 8081
Debugger
open the debugger tool from weinre from your desktop browser:
http://localhost:8081/client/
Finally,
select any target in Targets part and then start debugging.
Remote debugging web views only works on devices with android 4.4 and above.
have a look at this :
https://developer.chrome.com/devtools/docs/remote-debugging

Chrome does not show network traffic of Silverlight RIA services messages after update to version 32.0.1700.76 m

Couple days ago Google Chrome automatically updated from version 31.* to version 32.0.1700.76 m. After that happened it does not show in DevTools network traffic request/responses of "application/msbin1" type anymore. These requests are visible in all other browsers' dev tools (FireFox, IE) and in Fiddler, but not in Chrome. Also Chrome's popup menu in this version is very glitchy.
I don't see the way to downgrade Chrome to previous version. Please help I don't want to uninstall Chrome.
Network traffic does not even show resources (XAP file) a page loads.
Example:
http://www.microsoft.com/silverlight/pixel-shader/demo/
This page loads file SilverlightShaderApp.xap, however dev tools of new Chrome's version never shows it in network tab.
I posted the question here, because it's developers question, not just chrome users.
I reported this issue on google chrome forum as well: here.
Possibly related bugs:
Issue 173844: Developer tools (Network section) don't show response of requests from flash applications
Issue 335502: XMLHttpRequests from Silverlight is not visible in devtools network tab
To avoid the bug, you could downgrade to Chrome 31. A fully offline installer can be downloaded from http://download.oldapps.com/Chrome/31.0.1650.39_chrome_installer.exe.
If you downgrade Chrome, don't forget to disable auto-update. Also, "star" the relevant issues on Chromium's issue tracker so you'll receive email notifications for progress updates. When the issue is fixed, enable auto-update again.
Often, starting a new version of Chrome renders a profile unusable for older Chrome versions ("Your profile can not be used because it is from a newer version of Google Chrome."). When you see such message on start-up, either delete your old profile (don't forget to make a back-up!) (you can also try to delete some files, according to various users, deleting "Web Data" and "Web Data-journal" is sufficient), or launch Chrome with a new profile directory (--user-data-dir=path\to\profile-dir).
For more information on user profiles, see http://www.chromium.org/user-experience/user-data-directory.

Blackberry Ripple Emulator on click start services does nothing

I want to package and launch my BlackBerry Hello World application for WebWorks. For developement, I am using the Ripple emulator. The Ripple simulator says:
The build and deploy services are not currently running, would you like to start them?
After pressing the button Start Services nothing happens and no errors are in the error console.and i also did below steps as i have searched and get this result:
There are two reasons this might be happening. The first is that Chrome is preventing this from happening.
Open the Tools --> Extensions screen in Chrome
Enable 'Developer Mode' checkbox if it isn't already
Are you running Chrome in Incognito mode? If so enable the 'Allow in Incognito' checkbox
The other options is that nodejs is being blocked. If you're on windows, I'd suggest making sure that all user permissisons are enabled to allow you to run Chrome in a way that it can launch external processes.
And After doing all when ever i refresh page it says
The build and deploy services are currently running at localhost:9910. and after loading that page this message not visible but
The build and deploy services are not currently running, would you like to start them? message still there! please explain what's wrong here?
Thanks
This issue is solved by removing Ripple extension version 0.9.15 and installing version 0.9.16 (latest as of this posting), and restarting Chrome. When you click the 'Start Services' button, the console should appear displaying a build service start up message.
http://developer.blackberry.com/bbos/html5/download/
Install the latest beta and it should work!

Blackberry webview can not connect to internet and/or display a web page

I am creating a simple app using Eclipse and Blackberry JRE 7.0 as per the example given at:
http://docs.blackberry.com/en/developers/deliverables/11958/Configure_a_browser_field_825671_11.jsp
I am trying to load a simple HTML page hosted on a remote server inside browser field in the app.
When running the app on 9930 Simulator I always get the error 'Local connection timeout after 120000 on simulator'. The same remote page shows up fine on the web browser of the same simulator..
I am making sure to start the MDS simulator.
The same link shows up fine in simulator browser. Its only when using browserfield, I am having the problem.
I get the folling error when clicking the icon to launch the app:
Error displaying content for: http://yahoo.com
Error message: java.lang.runtimeException:ApplicationRegistry:wai​tFor
(0xd0fe7d7338fourd7f0d) timeout
....
On waiting further I get the 'Local connection timeout error..
I know that in Android one has to enable internet connection when using the webview in the manifest file - is there any similar setting one has to do in blackberry?
I tried to run the BrowserField demo app on 9930 (JRE 7.0.0) and encounter the same issues as you did. On the other hand, the demo worked fine on 9800 (JRE 6.0.0). I tried again on 9930 and noticed that though I definitely enabled MDS (enabled the 'Launch Mobile Data System Connection Service (MDS-CS) with simulator' in the Run/Debug Configurations in Eclipse), the MDS window didn't appear which seemed very strange.
I googled a little and found this post on BlackBerry's forums. According to this post:
An incorrect version of MDS-CS simulator was included in 7.0. To correct it you can delete it and copy the version from 6.0.
Well done, RIM!
Then, I deleted the MDS folder from JRE 7.0.0 and copied the one from JRE 6.0.0 as described in the aforementioned post. Closed and rerun simulator and voilà, the MDS window appeared. Rerun application, and everything worked like a charm!