I have custom WinForm web browser control that works fine in most cases. The problem I'm having is connected with local storage events.
When adding a listener to the storage event (javascript):
window.addEventListener('storage', eventHandler,false)
the eventHandler function is never called. I have tried this with more than one window open (hosting the web browser control), but it does not work. If I open a regular browser (IE10) and my custom browser, it will only trigger the storage event in the regular web browser when I write to local storage in the custom web browser, not the other way around.
Listening to the storagecommit event works ok in the custom browser control:
window.addEventListener('storagecommit', eventHandler,false)
but that event is only triggerd in the browser that wrote to local storage.
Below is a sample web page I use to test local storage events:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Test</title>
<script>
function eventHandler(e) {
alert(e);
};
function writeToLocalStorage() {
window.localStorage.setItem('test', 'test');
}
window.addEventListener('storage', eventHandler, false)
</script>
</head>
<body>
<p><button type="button" onclick="writeToLocalStorage();">Test</button></p>
</body>
</html>
If anyone can provide some help it would be very appreciated.