Profiling Webworkers in Firefox - performance

I am trying to profile a Javascript app with Firefox Quantum. The part that I am most interested in runs inside webworkers. I am not sure if I am doing everything correctly, but I cannot find a way to get any useful data with the built in profiler. All I can see is this:
Is there a hidden feature that can help me look inside the webworker?

For anyone else finding this in the future: https://profiler.firefox.com/ is able to profile Web Workers.
You need to open the Resources drop-down and choose Thread: DOM Worker.

After further looking into this I came to the conclusion that Firefox does not support runtime analysis for web workers at the moment. I will have stick with Chrome for profiling our app.

Related

Desktop application using Firefox WebExtensions

I am working on a XUL desktop application, where I use the browser tag and load a URL in that tag within the desktop application.
However, some websites display as old format and according to Mozilla, XUL is deprecated and will not be useable at the end of 2017. I want to build the application with the latest technology: WebExtensions.
I have searched many examples on the usage of WebExtensions, but all are working within the browser. Can I make a standalone desktop application just like XUL, but using WebExtensions?
If yes, then please give me some hints on how to get started.
If no, is any alternative for the same requirement available?
Webextensions are fairly limited in their scope. Even if there was an application runtime utilising them, you probably wouldn't get much use out of them due to the restrictive isolation from the host system.
Strictly speaking not webextensions, albeit very similar:
The Electron framework/runtime*
Someone at Mozilla is also working on an alternative dubbed "Positron"** though that software's future is uncertain and there is a chance he might abandon it for an entirely new, highly simplified project (at least that's what I gathered from my conversation with him on Github).
*http://electron.atom.io/
**https://github.com/mozilla/positron

Debugging AngularJS web app in Firefox extensions

I have created a Firefox extension that loads an iframe. That iframe loads a web application built using AngularJS. Is there anyway to inspect what is going on? The application loads but I have 2 input boxes that I am unable to type in.
I've developed the extension in both XUL and using the Add-On SDK and both of them don't allow me to interact with the input box. I've further noticed that when I remove the ng-model attributes, interaction works. It seems like data binding is an issue.
Any ideas?
Thanks
Without seeing the code, it's hard to say what's going wrong. If I were running into this problem (and I've run into similar ones), I generally fall back to editing the Angular source, and adding dump (or console.log) statements to try and trace what's going on. It's pretty terrible, but it usually gets the job done.
Good luck!
This question is kinda old by now, but as a reference for people coming here from a web search:
you might want to look at this SO question that lists some things that can go wrong with AngularJS inside XUL extensions, together with some solutions.

JavaFX replace AJAX?

Can JavaFX replace what AJAX do? i went through a couple of articles like this http://www.ajaxlines.com/ajax/stuff/article/ajax_vs_javafx.php. But I am still confused. anyone help??
I don't think this will happen, certainly not at the moment. JavaFX depends on java, there's very little support cross-platform (windows mobile does work but it's very limited). There was talk about set top boxes coming out to run javafx but it doesn't seem to have taken off :\ It's a real shame, in many ways I really like JavaFX. It's a shame they won't open the source. Also for deployment there is a dependancy on a sun server to get some jars (not possible to host on your own server), so when it goes down (and it is a when) then everyones apps stop working!
Javascript keeps my vote unfortunately.
Technically, yes JavaFX can do everything that AJAX can do and more - on a supported platform. Unfortunately JavaFX isn't supported on most smartphones so you won't get the same reach as AJAX. You also need a browser plugin which you don't need for AJAX.
But if these limitations aren't a problem, then I think you will have less misery using JavaFX instead of AJAX.

How to Programmatically take Snapshot of Crawled Webpages (in Ruby)?

What is the best solution to programmatically take a snapshot of a webpage?
The situation is this: I would like to crawl a bunch of webpages and take thumbnail snapshots of them periodically, say once every few months, without having to manually go to each one. I would also like to be able to take jpg/png snapshots of websites that might be completely Flash/Flex, so I'd have to wait until it loaded to take the snapshot somehow.
It would be nice if there was no limit to the number of thumbnails I could generate (within reason, say 1000 per day).
Any ideas how to do this in Ruby? Seems pretty tough.
Browsers to do this in: Safari or Firefox, preferably Safari.
Thanks so much.
This really depends on your operating system. What you need is a way to hook into a web browser and save that to an image.
If you are on a Mac - I would imagine your best bet would be to use MacRuby (or RubyCocoa - although I believe this is going to be deprecated in the near future) and then to use the WebKit framework to load the page and render it as an image.
This is definitely possible, for inspiration you may wish to look at the Paparazzi! and webkit2png projects.
Another option, which isn't dependent on the OS, might be to use the BrowserShots API.
There is no built in library in Ruby for rendering a web page.
Using Selenium & Ruby is one possibility. You can run Firefox as a headless browser (ie on a server).
Here is the source code for browser shots. http://sourceforge.net/projects/browsershots/files/
If you are using Linux you could use http://khtml2png.sourceforge.net/ and script it via Ruby.
Some paid services to try and automate
http://webthumb.bluga.net/home
http://www.thumbalizr.com
as viewed by.... ie? firefox? opera? one of the myriad webkit engines?
if only it were possible to automate http://browsershots.org :)
Use selenium-rc, it comes with snapshot capabilities.
With jruby you can use SWT's browser library.

How can I check my AJAX for browser capable?

I always have to check each and every browser to see if my website would work. Is there a website where I can check it with?
Update:
I don't really want just screenshots (which what browsershots do), I want to actually test the posting of my script.
You want a web site to check your web site for javascript compatibility? How would you expect it to know how to exercise your interface to trigger the proper interactions? Or are you thinking of it doing some sort of static code analysis? I think you are better off coding against a framework that has solved most of the browser-dependent idiosyncrasies and using it to check for browser capabilities before you use them. jQuery, MooTools, Prototype/Scriptaculous, etc. go a long way in solving these problems for javascript.
Note that you still need to worry about rendering your site, but you already have several answers for how to go about doing that based on web sites. Personally, I just maintain IE/Safari/FF/Opera/Chrome on my workstation and do significant checking in IE/FF and basic checking in Safari/Opera/Chrome.
Even when there exist websites that allow you to see a static snapshot of your site in several browsers, you should really test your page on them yourself, because there can be subtle, and not so subtle, bugs and differences that are only apparent when interacting with the webpage.
You can cover yourself quite a lot by testing in
A Gecko engine browser (Firefox)
A Webkit engine browser (Chrome, Safari, Konqueror)
Opera
AND IE6+
John Resig recommends checking the Yahoo graded browser support documentation.
If you write unit tests for your javascript, you could use testswarm http://testswarm.com
There are multiple options:
http://ipinfo.info/netrenderer/
These site will let you run multiple browsers and version without installing. You only need to install a plugin
http://spoon.net/browsers/
There are plenty of sites, just Google/Bing for browser compatibility check.
http://browsershots.org/ is a good one.
Although most of them just take a snapshot of the site, you might have to do the manual check for things like menus and dynamic content.
BrowserShots might do what you want if you can tell by rendering a particular URL whether or not things will work as expected.
In light of your update, you could still use BrowserShots by creating a page which tests each of your scripts and renders 'pass' or 'fail' as its content depending on whether they work or not.
Failing that, Multiple IE is quite useful for running various versions of IE on one PC which can otherwise be problematic.

Resources