I am wondering if there is some event that is emitted when browser has crashed. I would like to start a new browser when some browser has crashed.
I am running multiple browsers (each with different proxy).
Also is there some function that will return count of open browsers (where is atleast one tab opened)?
Related
I opened my website in Chrome last night, then closed that tab, but didn't close browser. Today I failed to open my site in a new tab because jQuery(not use CDN) hits a syntax error: unexpected end of input.
My site always hits this error no matter how many times I refresh. But the error didn't happen again after hard refresh.
This problem happens many times in recent months.
I checked Chrome devtool, it says my jquery.min.js is loaded from memory cache. And it is not a whole file, only contains part of jquery library. That's why I got syntax error.
I did some research from google:
The lifetime of memory cache is attach to the lifetime of render process, which roughly corresponds to a tab.
So if I create a new tab to visit my site, stands to reason, jQuery should not be loaded from memory cache.
I expect browser do not load my files from memory again if I visit site in new tab.
Is there anything I can do to locate the problem source and fix it?
EDIT (2019-05-13):
Today hit this error again, but fortunately, I found new point seems helpful to this problem.
This is that request:
See status code is 206 Partial Content (from memory cache).
And I have no idea why my request header contains 'Range' field.
You can't detect newtab in browser and load your jquery.min.js,But you can avoid loading from cache by adding timestamp into suffix of your lib like follows.
http://yoursite.com/lib/js/jquery.min.js?1557301884
You can achieve this in two ways
Case:1 If you are using server side page rendering means(PHP,JSP) just print the timestamp
Case:2 If Client side means some javascript stuff you have to do
I'm getting an error in Chrome for an offline web app. Google Chrome always fails on the third video, despite the URL being correct and clicking on the URL in the Google Dev Tools' error message, opens and plays the video in a new tab. (It's always the third, even if I change the order of the videos)
The manifest has three videos (each 30-40 MB). All three can be viewed in chrome and are listed in the manifest. It shows a message that it's downloaded the first two videos but the third always ends in this message:
Application Cache Error event: Resource fetch failed (2) myvideo3.mp4
I know the manifest is correct because (as mentioned), clicking on the URL in the error message plays the video in a Chrome tab.
Since it always fails on the 3rd video despite changing the order in the manifest, I believe it's a limit on app cache size. How do I increase this for my app? This is a desktop.
CACHE MANIFEST
CACHE:
test.php
image.png
videos/myvideo1.mp4
videos/myvideo2.mp4
videos/myvideo3.mp4
EDIT: Some more info:
When I have three videos listed, it loads two and fails on the thrird. BUT, when I take the third off and only have two listed in the manifest, it fails on the 2nd video! What could cause this? (If I have only one video, then it loads that one and the whole manifest)
Using:
Google Chrome 43 on Desktop (64-bit)
There's not just a per-web-app size limit, but also a per-file size limit. From this post (and confirmed by my testing), it's 32mb per file and 260 MB per web app.
Not sure how to find out the limit on other browsers as this seems to be undocumented.
If I understand this API documentation correctly: https://developer.chrome.com/apps/offline_storage
...
Then it is saying Application Cache is part of Temporary Storage where you cannot ask for more space and you get a maximum of 20% of the pool.
navigator.webkitTemporaryStorage.queryUsageAndQuota (
function(usedBytes, grantedBytes) {
console.log('we are using ', usedBytes, ' of ', grantedBytes, 'bytes');
},
function(e) { console.log('Error', e); }
);
This function told me I have 100MB of granted space. So I assume my app has 20MB? How do I know how much each individual file can be?
I don't know about the limits mentioned in the post above, they seem to be referencing an old answer.
If I press a button multiple times as fast as possible in chrome, it will throw an error of failed validation. In I.E its fine. The button will validate the data in the page and then load new data(paging). The validation is the first step, then loading the next data is the next step. If I click 10 times, each call must wait for the previous to finish right.
edit: I noticed when I disable chrome default flash player of 18, and use the installed version of 16, the bug is gone. Is there some major difference of 18>16?
Given that there is a way to invoke an update directly using window.applicationCache.update(), is there any way to omit the update that is performed automatically by the browser when the page is loaded?
I've been experimenting with offline mode in Google Chrome, and so far it appears that
1) If a manifest file is specified, it will be loaded, and there is nothing I can do in JavaScript to stop it.
2) If the manifest file has changed, the entire cache is going to be updated, and there is nothing I can do to stop it.
In my experience, window.applicationCache.abort() has no effect regardless of when I invoke it. I've tried invoking it on the first line of javascript, and in the checking and downloading events, but it always downloads everything. It may have something to do with timing since the files are small and load very quickly.
Listen for the checking event and cancel it. The abort() method doesn't come into things until step 17 of the application cache download process, I don't think you're going to be able to stop the process with it.
This is a Chrome bug at the time of writing: https://code.google.com/p/chromium/issues/detail?id=175063 (please vote it up)
Just tried this on iOS Safari:
window.applicationCache.addEventListener('checking', function(event) {
window.applicationCache.abort();
}, false);
It works. In Safari debugger console:
Application Cache download process was aborted.
Chrome ignores the same code.
In HTML caching, my understanding is that when the manifest file is updated on the server, the browser downloads the latest files and swaps the cache.
Is there a way to stop the browser doing this until the user gives the go-ahead?
For example, displaying a notification to the user saying something like "there is a new version available. Do you want to download it? Y/N". If the user says "No", then the browser should keep the old files around.
Handle the updateready event and then conditionally call swapCache().