Assume that you're developing a browser extension. Is there any way to monitor the performance of that browser extension that has been installed on all those browsers?
Ie, can you somehow monitor whether the performance degrades on a new release of the extension, etc.
There are ways to monitor the performance of your browser extension.
For Chrome:
You can simply view the built-in Chrome Devtools by clicking F12/Ctrl + Shift + I or right click and choose Inspect.
From there you can:
Analyze Runtime Performance - you can check the Javascript, Style, Layout and Paint and composite calculations
Analyzing Network Performance - to understand why a page loads slowly
Analyze Memory Problems - to find memory issues that affect page performance, including memory leaks, memory bloat, and frequent garbage collections.
For FireFox:
Firefox has a responsive design view that encourages you to stop thinking in terms of specific devices and instead explore how your design changes at common screen sizes or your own size by dragging the edges.
For Edge:
To emulate Windows Phones, use Microsoft Edge's built-in emulation.
Since Edge does not ship with legacy compatibility, use IE 11's Emulation to simulate how your page would look in older versions of Internet Explorer.
Note: Browser emulators are great for testing a site's responsiveness,
but they don’t emulate differences in API, CSS support, and certain
behaviors that you'd see on a mobile browser.
For more infos:
Creating One Browser Extension For All Browsers: Edge, Chrome, Firefox, Opera, Brave And Vivaldi
Emulate and Test Other Browsers
Related
I have worked on a chrome plugin for one of the cloud based product. For The Chrome we have used third partly JS libraries like BackboneJS etc. Now I have to design a Firefox Extension, I am trying to figure out how much code we can reuse. Apparently spending few hours with Mozilla Developer site it seems like for Firefox Extension we have to use XUL for the UI. Not sure if we can use the html and javascript functions from Chrome App for the Firefox Extension, or what would be the approach to estimate the effort. My Understanding is that we have to do it from the scratch since like Chrome in FF we dont have concepts like background page etc.
There is nothing inherent that prevents you from implementing a UI in HTML/JS. You might have to wrap it in an XUL <iframe>, or <browser> (potentially other elements) within a <window> (Firefox will open pure HTML).
The key issue regarding extensions is that they execute in an elevated security context vs. webpages. As such, they have the ability to affect a much larger range of things in the browser and on the users system. When <iframe>, or <browser> elements are used, they have a property type which defaults to having the contents operating in the elevated security context. The default value is type="chrome" which makes the content opened be in the extension's higher security context.
Additional docs from MDN regarding security concerns with opening content in <iframe>, or <browser> elements which is not sourced from your extension distribution: Security best practices in extensions and Displaying web content in an extension without security issues
As to your JavaScript: You should be able to re-use a significant amount of it. At a minimum, the logic. Obviously, there will be more significant differences in how you accomplish interfacing to the aspects of the browsers which are not covered under standards documents (e.g. DOM manipulation should be very close, just as it is for webpage JS).
I have encountered a strange condition which produces bad performance with our DisplayObjects.
Here is the situation:
We use Stage3D and direct mode for our 3D Flash Web Gaming Project.
We use CS6 to build our GUIs for this project. In (and only in) Internet Explorer, the performance becomes bad when the screen is switched from Flash Fullscreen Mode (not browser full screen) to Normal Screen Mode.
Our Main Game GUI, which is a DisplayObject, has many children.
After several tests, I finally found that the performance does not get bad when the property mouseChildren of Main Game GUI is false or without "direct mode".
Given that this situation only happens in Internet Explorer with FlashPlayer's direct mode, is there any way for me to revise my code?
Are there any programs that render websites from the point of view of different browsers? In other words, I'd like to be able to open and view websites as if it were Internet Explorer, Firefox, Chrome, Safari, etc.
It would be a bonus if the utility has a paned interface that lets you view pages side by side.
Thanks!
also can use adobe's https://browserlab.adobe.com/index.html
BrowserLab provides web designers exact renderings of their web pages in multiple browsers and operating systems, on demand. BrowserLab is a powerful solution for cross-browser compatibility testing, featuring multiple viewing and comparison tools, as well as customizable preferences.
updated,
you can also litmusapp, another excellent utility, allowing you to test a website in different browsers but also emails.
http://browsershots.org/
I am having my first foray into website design and I am learning a lot. I am also now seeing why web developers are not a huge fan of developing for Internet Explorer. Nothing seems to work how I expect. However, since the website has to work cross-browser, I am spending time looking at it in Firefox, Chrome, and IE. Something that is very non-obvious to me, however, is how to tell where problems lie in the website.
For example, the layout of one of my pages forces a footer to the bottom of the page. It looks great in Chrome and Firefox, but there's something broken in IE that make the footer align to the right (and cause a horizontal scroll to appear). I have played around with the code, but nothing really is responding to how I want in IE (even though it does in other browsers).
Are there any tools that can help "debug" the problems on a web site so fixing it is more than just a trial-and-error approach? Thanks.
One of my favorites that works in all browsers is X-Ray. You simply stick the link on that page into a bookmark and it loads some external JavaScript on top of the page you're testing. It reveals a bunch of parameters about the DOM object you click on, as well as its hierarchy in the model.
As for your specific footer problem, I would look to a potential lack of clearing of floats and divs that are wider than their parent containers somewhere up the line.
There are frameworks like GWT, ext-js, YUI which hide a lot of the browser bugs from you. But today (near the end of 2009), there still isn't a good, realiable way to narrow down browser issues and to fix them.
PS: I'm collecting tools that help during debugging here: Which tools do you use to debug HTML/JS in your browser?
I assume you have checked that your code is valid, with
HTML validator, for example: W3C Markup Validation Service
CSS checker, for example: W3C CSS Validation Service
And, of course, you should have correct doctype in your html file. Without doctype, some browsers go to quirks mode to emulate bugs in old browsers.
A cross-browser JavaScript library, like jQuery and its UI components, can be very helpful in avoiding idiosyncrasies between browsers. Microsoft provides the IE Developer Toolbar, it's not quite as easy to use as Firebug, but can still be very helpful. A Just-In-Time debugger like MS Script Debugger or Visual Studio are also a time saver.
I like Firebug for Firefox
and IE8 has Developer Tools from the tools menu and IE Developer Toolbar for older versions.
Chrome has similar tools from the page menu.
All of which allow you to see elements on the page as they are rendered in their specific browsers, which I usually find very helpful in debugging browser specific problems.
What are the main differences (if any) between the box models of IE8 and Firefox3?
Are they the same now?
What are the other main differences between these two browsers? Can a web developer assume that these two browsers as the same since they (seem to) support the latest web standards?
The Internet Explorer box model has been "fixed" since Internet Explorer 6 so long as your pages are in standard compliants mode.
See: Quirks mode and Internet Explorer box model bug.
Until I learnt about doctype declerations getting IE to work properly was a real PAIN, because IE runs in "quirks mode" by default. So having a standards mode doctype will eliminate a whole bunch of the most painful CSS problems.
I would never assume that any browser renders a page exactly the same.. always test!
Even though they support standards, there are plenty of variations between different browsers and even different versions. FF1 renders differently to FF2 which renders differently to FF3.
You also have to remember that each browser has their own JavaScript engine which again, will cause some scripts to work and other to fail.
You can ofcourse reduce these differences by using CSS and JavaScript frameworks which have been developed to support multiple browsers.
However, you still must test in all browsers. There will always be something that doesn't quite look or behave right.
Things that will always differ between the two (and other browsers) are default values (font sizes in headings, for example). The way they achieve default visuals is often different, as well, such as whether or not they use padding or margin to achieve the indentation in bulleted lists.
Something quite positive that I just noticed is that IE8 finally fixes IE's handling of margin: 0 auto for block elements that you want horizontally centered in their respective parents.