Chrome extension debug "GET chrome-extension://invalid/ net::ERR_FAILED" - google-chrome

I'm developing a Chrome extension and recently I've been getting this error, in the extension's background.js page:
GET chrome-extension://invalid/ net::ERR_FAILED
I can't seem to find much information on how to debug this and prevent it. The initiator is blank, so I can't find what code in the background.js is actually causing this request.
Request details don't show anything either...
Any ideas on what this could be??

Related

How to prevent an error to occur in a script appended in chrome developer tools?

I have a script which I want to run it throw the console of developer tools.
The script is a fetch to an url: www.not-my-website.com/page-1/
Further, the www.not-my-website.com/page-1/ redirects to www.not-my-website.com/page-2/
www.not-my-website.com/page-2/ redirects to www.not-my-website.com/page-3/
....
www.not-my-website.com/page-99/ redirects to www.not-my-website.com/page-100/
And the error I get in the console is net::ERR_TOO_MANY_REDIRECTS 302.
That's because there are to many redirects made by the fetched url.
So, I need a way to prevent this behavior.
I want the script to be run and to prevent stopping the script to run.
I try to create a snippet and to set the debugger to ignore it. But the script still throws the net::ERR_TOO_MANY_REDIRECTS 302 error.
So, how can I prevent this behavior ?
I just want to run the script and not to be stopped because there are to many redirects. I want to run it. It has an end. On www.not-my-website.com/page-100/.
Attached a print of what I made and is not working. Some help ?
Chrome has a redirect limit of 20, and which can't be modified.

Lighthouse Report says: Audit error: libUrl.parse is not a function

When I generate a lighthouse report on my web application, I get this error:
and when I click on the Learn More link, it throws me a 404 error page.
I also tried to google this error message, but I couldn't find anything related to this.
Can anyone tell me why is this happening?
It is a known problem of the extension.
There is an opened issue in the Github of the project.

Simulating an error code in Chrome dev tools

From the dev tools, is it possible to tell Chrome to return, for example, a 404 when a specific url is requested (leaving other requests to process normally)?
You can block specific request URLs or patterns of URLs from the Network panel.
Manage your blocked URLs from the Request Blocking tab.
Official feature announcement: https://developers.google.com/web/updates/2017/04/devtools-release-notes#block-requests
Blocking the request with chrome devtools is the easiest solution. But if you want to mock a specific error code, let say 401 or 404 you can use a chrome extension to do it.
There are plenty of them in the store, I just tried one randomly and it allowed me to mock a specific error code https://chrome.google.com/webstore/detail/mokku-mock-api-calls-seam/llflfcikklhgamfmnjkgpdadpmdplmji?hl=en

Unexpected Error in Play Store Developer Console

I didn't have this problem before but for the last 2 days, I can't seem to open any of my apps in Developer Console. I log in to the Console without any problem and click&go to anything except my apps without any problem. However once I click on my apps it just brings out the error: "Unexpected Error, please try again."
The thing is... It only happens in Chrome. I tried with Edge and it works perfectly. I deleted cache and cookies in the Chrome but still no solution.

More Odd Firefox Cache Manifest Behavior: Redirect to Outside Domain Results in 404 Failure

I have an HTML5/Javascript (PHP/MySQL on the server) app with a cache manifest and it runs fine on almost all mobile and desktop browsers except for Firefox.
When I remove the cache manifest, it works fine in Firefox. Therefore, it's something odd with the cache manifest in Firefox that I can't figure out. It's loading a file from the cache, even though the file sends a Cache-Control: no-store, no-cache header.
The file handles the OAuth dance for getting a LinkedIn access token and follows these steps:
The app calls the file via Javascript using window.location.replace('file.php')
file.php loads and is redirected to file.php?param=initiate
file.php?param=initiate loads, gets a request token from LinkedIn, then redirects to the LinkedIn authorization page, then gets redirected to file.php?param=initiate&otherparameters
file.php?param=initiate&otherparameters loads, otherparameters is used to get an access token from LinkedIn, then reloads the app because now it has access.
However, on Firefox (16.0.2 on Windows 7), I get the following:
The app calls the file via Javascript using window.location.replace('file.php')
file.php loads and is redirected to file.php?param=initiate
(FireBug shows Status 302 Found and the Response Headers show the location /file.php?param=initiate)
file.php?param=initiate loads, gets a request token from LinkedIn, but does NOT redirect to the LinkedIn authorization page: it shows the 404 page (FireBug shows Status 302 Found and the Response Headers show the location https:linkedin.com/authenication link, but Firefox does not go to the LinkedIn page, it makes another GET request for file.php?param=initiate and loads it from the cache: Status 200 OK (BF Cache) and shows the 404 page).
file.php is NOT in the cache manifest.
Basically it does not go to the Location in the response header from step 3 that should take it to the LinkedIn authorization page, but I can't figure out why not.
Any ideas on how to fix this?
If you want to reproduce this problem, here's a link to a test event. Try to send a LinkedIn connection request and watch Firebug. All the LinkedIn profiles for this event (except mine) are dummy profiles, so don't worry about sending a LinkedIn connection request to a random stranger. You have to register first with your e-mail to get an activation link, but you can use a disposable e-mail address if you want to.
Some things I've tried:
No cache manifest: this fixes it, but I need offline functionality
Sending headers with various permutations of no-store, no-cache, must-ravalidate, past Expires date, etc.
Reducing the number of entries in the cache manifest
Various combinations of SETTINGS: prefer-online, NETWORK: *, NETWORK: https://*, etc.
I solved this problem by re-writing my LinkedIn/OAuth library so that it does everything via ajax instead of sending the Location header via PHP.
After much frustration I figured out why this problem was happening, so hopefully this will help others who face a similar predicament.
It turns out the cache manifest does not allow redirects to outside domains (this is probably documented somewhere, but it didn't show up for me when I searched for a solution).
Part of the problem was that I didn't know the redirect was causing the problem. I thought it was just the weirdness of the cache manifest. After all, it worked fine on Chrome and Safari and I didn't get any useful debugging info from Firebug.
Here's a useful article on the gotchas of cache manifest (this issue is listed as Gotcha #8).
Here's a link to the HTML Offline Spec (this issue appears to be listed in section 6.7.6(4), but the document is so opaque I can't event tell whether that's really what it's referring to).