Internet Explorer equivalent to window.performance.memory? - javascript

Does anyone know if IE has an equivalent to Chrome's window.peformance.memory property?
I am trying to find a way to analyse IE's memory performance in my application.
Running my js script using a Chrome browser is no problem, because Chrome has added a proprietary memory property to window.performance (see window.performance.memory for more info).
The way I do it in Chrome is like this:
browser.driver.executeScript(function () {
return window.performance.memory; // this is the problem, IE has no memory property
}).then(function (result) {
logResults(result.jsHeapSizeLimit);
logResults(result.usedJSHeapSize);
logResults(result.totalJSHeapSize);
}
});

Internet explorer, use navigation.performance to make other types of measurements. More reference to speed.
https://developer.mozilla.org/en-US/docs/Web/API/Performance
For example: window.performance.now()
On this page you can see all the data that can be obtained with internet explorer or other browsers. You must enter with the internet explorer in the url, to see the data with the browser
https://browserleaks.com/javascript
Other option is using: CTRL+Shift+U keys

Related

Browser component (IE) does not show values for document.getElementbyId

I am listening to a server event via a javascript function on my HTML file, which outputs the server answer in the console tab. Since I need to pass this answer to a delphi application, I made the server answer "visible" via a div container. This works fine on Firefox, but on IE the output is not shown. I have then tried to utilize the value of a textarea, which also works on Firefox but not on IE.
I really wonder why it is so hard to get a console output visible on IE?
document.getElementById('my_div_container').innerHTML = JSON.stringify(my_data_I_want_to_see, null, 4);
document.getElementById('my_textarea').value = JSON.stringify(my_data_I_want_to_see, null, 4);
The above lines show a result on Firefox, but on IE there is no output at all. How can I get my data visible on IE?
I found the root cause why IE did not show any console output. I just found out, that the addEventListener() method I was using is not supported in Internet Explorer 8 and earlier versions.
I am very sorry for any confusion.
If you are using TWebBrowser component in Delphi for displaying the webpage do note that by default it running in Internet Explorer 7 compatibility mode.
In order to avoid this you need to opt your program into browser emulation feature
How to have Delphi TWebbrowser component running in IE9 mode?
Don't forget to check MSDN documentation for proper registry value to enable emulation of most modern IE versions.

new Websocket() return wrong object in Firefox Quantum

I'm using Firefox Quantum (64.0) and the JS command new WebSocket() returns a different object from the specification:
MDN Websocket
HTML Standard
The missing property that is affecting my appllication is the .close() function, but there is another differences.
You can see in the image bellow that the returned object has a .websocket porperty that contains all the missing ones.
websocket object
Am I doing something wrong? With older versions of Firefox (before Quantum, like 43) or with chrome it works fine.
If it is a problem with firefox, how can I report it?
EDIT:
Adding some code example:
var exampleSocket = new WebSocket("wss://echo.websocket.org");
exampleSocket.close() // Throw "exampleSocket.close is not a function" in Firefox Quantum, works on chrome
exampleSocket.websocket.close() // Works on Firefox, Throw on chrome.
This exampleSocket.websocket is not in the documentation.
Edit2:
I tested in other machines that have the firefox versions 60, 61, 63 and 64 and the problem only happened in my machine.
When I removed all plugins from firefox it started to work again.
The problem was the websocketsniff plugin that I had installed.
It even state that the WebSocket object will change:
Inspect websocket frames in Firefox. How to use: 1) Open Developer
Tools 2) Open "Websocket Sniffer" tab
This extension replace native websocket object for custom object. It
is dirty hack, but it is single decision

dojo.exists fails with IE11

Since a few days, I have troubles with Internet Explorer 11 in conjunction with dojo toolkit 1.9.4 hosted by a Domino Server.
Source Code:
if (dojo.exists("btnUpload")) {
console.log("btnUpload exist ... do something...");
} else {
console.log("btnUpload doesn't exist...");
}
With IE11 the return value of dojo.exists() is always false!
IE11 Debugger:
However in all other browser (Mozilla Firefox, Google Chrome, Apple Safari) it works!
Using dojo.exists for this isn't very appropriate, given that btnUpload is technically just a DOM ID, and not an actual object in the global scope. if (document.getElementById('btnUpload')) would seem to be far more appropriate in this case.
When a global reference is encountered that doesn't match an actual global variable, but does match a DOM ID, browsers tend to return the DOM node, but I wouldn't recommend relying upon that.

Name.NameCtrl PresenceEnabled in Visual Studio debug window

I'm using the following code to get contact presence on a web page:
nameCtrl = new ActiveXObject("Name.NameCtrl.1");
if (nameCtrl && nameCtrl.PresenceEnabled) {
presenceEnabled = true;
nameCtrl.OnStatusChange = onPresenceStatusChange;
// ...
}
It works perfectly when I run it in VS but only from a separate Internet Explorer window, doesn't work in the debug IE window started by Visual Studio (so I cannot debug JS code). What happens is that initially nameCtrl.PresenceEnabled is set to true (just after creating ActivexObject) and then is changed to false, I don't get any status updates and all GetStatus calls return 1.
Any ideas how to make it work in Visual Studio?
I'm targeting IE and Lync.
The whole nameCtrl turns out to be very difficult to debug. Some things to check:
If the plugin doesn’t work in IE11, but works if you change the document mode to IE10, it is because IE11 no longer recognizes ActiveXObject as a property of the window object. (see: http://msdn.microsoft.com/en-us/library/ie/dn423948(v=vs.85).aspx).
No javascript errors but nothing seems to be working? For this to work, you may need to go into Internet Explorer’s Internet Options menu and add your domain (or localhost) as a trusted domain.

Get OS Win 7 username Javascript

Is it possible to get Windows username and PCName with Javascript in browsers IE, Chrome, Firefox, Opera?
No. That sort of information is not exposed to the javascript engine in the browser.
i'd really wish this wouldn't be possible, but sadly it is (or was). i don't know for sure if this still works on Win7 and with current browser-versions, but in the past you could do this...
Internet Explorer
function getUsr() {
var wshell = new ActiveXObject("WScript.Shell");
return wshell.ExpandEnvironmentStrings("%USERNAME%");
}

Categories