Thus far this is what I've tried, I'm using Firefox 3.07
Make sure in about:config that the property browser.cache.check_doc_frequency is set to 1 which the browser interprets as "check for a new page every time".
Make sure in about:config that the property security.fileuri.strict_origin_policy is set to false.
When opening your browser be sure to specify to the testrunner.html page which test you want to run using the testpage parameter,I.E.: file:///.../testRunner.html?testpage=c:/temp/someTest.html
Tak an additional random parameter on the end to ensure that the cache is gone.
Everything above seems to work, except it is still caching my *.js files for some stupid reason. I really thought it would have had to do with changing the random parameter at the end to kill the cache, but that doesn't seem to be doing the trick. What else can be done to make JSUnit work with Firefox 3.07? The files are located on my hdd.
Have you tried CTRL + SHIFT + R to refresh without using cache?
No, that doesn't work. The problem is that it is caching the *.js files. When you do CTRL + SHIFT + R it is only refreshing the test runner page.
Thus far this is what I've tried, I'm using Firefox 3.07
1.
Make sure in about:config that the property browser.cache.check_doc_frequency is set to 1 which the browser interprets as "check for a new page every time".
2.
Make sure in about:config that the property security.fileuri.strict_origin_policy is set to false.
3.
When opening your browser be sure to specify to the testrunner.html page which test you want to run using the testpage parameter,
I.E.: file:///.../testRunner.html?testpage=c:/temp/someTest.html
4.
Tak an additional random parameter on the end to ensure that the cache is gone.
Everything above seems to work, except it is still caching my *.js files for some stupid reason. I really thought it would have had to do with changing the random parameter at the end to kill the cache, but that doesn't seem to be doing the trick. What else can be done to make JSUnit work with Firefox 3.07? The files are located on my hdd.
Try editing the network.http.use-cache property in about:config.
e.g., network.http.use-cache = false
Was pulling my hair out with same problem.
This finally worked for me:
Firefox Menu: Tools/Web Developer/Disable/Disable Cache
Related
I came across a website that runs this code:
function check(){console.clear();before = new Date().getTime();…
^^^^^^^^^^^^^^^
on load, discarding valuable console messages. How can I make Firefox
ignore console.clear() globally?
I wonder why that even exists in the first place. It should not be
possible for a website to delete potentially relevant debugging output.
You can solve this in two ways,
First, you can write a firefox extension which executes a javascript on page load and assigns empty function to console.clear. So, it doesn't throw any error if its called.
console.clear = () => {}
References for building extension to run on page load
Chrome Extension: Make it run every page load
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Modify_a_web_page
Secondly, you can load the page once and open devtools and goto sources and search for console.clear and add breakpoints every where its called and reload the page. The code execution will stop when the console.clear is called for the first time and again you can goto console and assign console.clear with empty function and override.
Reference for Using BreakPoints in Firefox
https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Set_a_breakpoint
Since you're asking about Firefox, if you don't want to write your own extension, you can use the one that already exists:
Disallow Console Clear Firefox Addon
It is right to hijack the console.clear on page load.
Here just a tip/record.
For some sites, there would be no explicit word console.clear in the sources. (And sadly, currently Firefox's Preserve Log option might still not be as powerful as Chrome's)
But the hijack might still work even!
BTW it might happen that "directly reassigning console.clear in console" not works.
So just try it.
For some unfathomable reason I can reliably detect double spaces in text input elements on localhost but not on live sites with everything verified (deleted/upload files, browsing with cache disabled, manually verifying the script file is updated, testing in the console, etc).
My original code:
if (document.getElementById('example').value.indexOf(' ')!='-1') {}
My second attempt:
if (document.getElementById('example').value.split(' ').length>1)
I'm completely baffled, the script works fine in Firefox and Chrome locally though not live and I am absolutely 100% certain that everything on the server has been updated. I've even run the validation with the script commented out just to make certain.
Got it! So I don't know what the heck was wrong with the other code...it worked fine on localhost and I'm at a complete loss about that issue however I did some more poking around and determined that I can detect double spaces in JavaScript using the following:
if (document.getElementById('example').value.match(/\s{2,}/)!=null)
I am a chronic user of Firebug, and I frequently need to log various stuff so that I can see what I am doing. The console.log function is a lot to type. Even if I assign it to a single letter variable like q = console.log, I have to do it every time I fire up Firebug. Is there any way to do it such that q always refer to console.log (unless, of course, I override it in my session)?
To answer your question, the functionality doesn't currently exist, however I have found the firebug developers to be very responsive in the past. Why don't you put in a feature request on their forum, or better yet, code it up yourself, and ask them to add it?
Depending on your IDE, simply setup a code snippet (I use Flash Develop, so Tools -> Code Snippets).
I believe this to be a better way than setting up redirect scripts and what not, because it stops the Firebug namespace from being polluted, and makes it easier/more consistent to debug if your debugging breaks down.
The screenshot shows me using Flash Develop, hitting Ctrl+B, then hit enter. The pipe (|) in the snippet indicates where the cursor will be placed to start typing after inserting the snippet.
As part of a loading screen for an offline-enabled web application I'm building (using a cache manifest), I'd like to display an accurate progress bar that lets users know which files has thus far been downloaded and which are still pending. Something like the following:
Loading...
/assets/images/logo.png: loaded
/assets/images/splashImage.png: pending
I know that I can use the cache "pending" event, but I don't see that the event arguments have any data associated with them.
Is there any way to do this?
There is a progress event that gets triggered when each file downloads, however its payload does not include the file name in any browser that I've tested with (Chrome, Safari, FF beta). Chrome displays the file name in the Console (though as far as I know it's inaccessible to JS), but neither Safari nor FF even go that far. And from what I've seen, the files do not download in the same order that they're listed in the manifest, so there's not even a way to generate an ordered list then knock them off one at a time.
So in answer to your question, no, there isn't any way to do this right now. It's possible that in the future the progress event will include the filename - at least in some browsers - but right now this isn't possible.
I should add that in Chrome (not in Safari or FF) you can at least get a count of files to be downloaded, allowing you to at least calculate an accurate progress bar. To get this in Chrome you'd use the following:
function downloadProgress(e) {
totalfiles = Number(e.total);
}
window.applicationCache.addEventListener("progress", downloadProgress, false);
However this will error out in other browsers, so you need to wrap a try/catch or some other method (typeof(e.total)) to avoid the error.
This is a few years late, but maybe it'll help someone else who's researching this.
It doesn't list the files or anything, but it shows an accurate(ish) progress bar based on the total number of files loaded. It may still need a little work...
https://github.com/joelabeyta/app-cache-percent-bar
We recently started using SVN Keywords to automatically append the current revision number to all our <script src="..."> includes (so it looks like this: <script language="javascript" src="some/javascript.js?v=$Revision: 1234 $"> </script>). This way each time we push a new copy of the code to production, user caches won't cause users to still be using old script revisions.
It works great, except for IE6. For some reason, IE6 sporadically acts as though some of those files didn't exist. We may get weird error statements like "Unterminated String Literal on line 1234," but if you try to attach a debugger process to it, it won't halt on this line (if you say "Yes" to the debugger prompt, nothing happens, and page execution continues). A log entry for it shows up in IIS logs, indicating the user is definitely receiving the file (status code 200, with the appropriate amount of bytes transferred).
It also only seems to happen when the pages are served over https, not over standard http. To further compound things, it doesn't necessarily happen all the time; you might refresh a page 5 times and everything works, then you might refresh it 20 more times and it fails every time. For most users it seems to always work or else to always fail. It is even unpredictable when you have multiple users in a corporate environment whose security and cache settings are forcibly identical.
Any thoughts or suggestions would be greatly appreciated, this has been driving me crazy for weeks.
Check your log with fiddler2 to make sure the browser request the page, and do not use the cache instead. Also check the URL of the JS script and the header returned.
Are you using GZip? There has been issues reported with it.
I would suggest testing using Internet Explorer Application Compatibility VPC Image. That way, you can do your tests with a 100% IE6, and not one of those plugin that claims to simulate IE6 inside another browser.
I think this is a very clever idea. However, I think the issue could be related to the spaces in the url. Technically, the url should have the spaces encoded.
See if you can customize the keywords in SVN to generate a revision number without special characters.