CHunky Universe of Vigourous Astonishing SHarepoint :)

Tag Archives: window

clearInterval in Chrome doesn’t work on window blur

If you want to reset all interval jobs when a browser tab is inactive, the best way would be to use clearInterval on window blur. But unfortunately Chrome fires window focus and window blur two times. Here is an embryo to a solution:

var M = window.M || {};
M.counter = 0;
M.focused = true;
M.tick = function() {
  if (M.focused) {
		console.log("tic tac " + ++M.counter);
M.start = function(e) {
	M.focused = true;
M.stop = function(e) {
  M.focused = false;
	focus: M.start,
	blur: M.stop

M.ticker = window.setInterval(M.tick, 1000);

javascript: passing arguments from popup to main window

To show a popup, we just have to invoke “”, and provide some options to prevent opening this in a new tab:

var wnd ='', '_blank', 'width=750, height=400, location=no, resizable=1, menubar=0, scrollbars=0');
wnd.document.close(); wnd.document.close(); wnd.focus();

To communicate between parent and child we can refer to parent as window.opener. We can even invoke a function from parent window. Let’s create the most useful function:

foo = function() { console.log("foo"); }

Then just click on “hej” in the popup, and see the console.

Next: Using javascript objects passed from closed popup

Daniel Chronlund Cloud Tech Blog

News, tips and thoughts for Microsoft cloud fans

Вула Чăвашла

VulaCV - Чăвашла вулаттаракан сайт

Discovering SharePoint

And going crazy doing it

Bram de Jager - Architect, Speaker, Author

Microsoft 365, SharePoint and Azure

SharePoint Dragons

Nikander & Margriet on SharePoint

Mai Omar Desouki

PFE @ Microsoft

Cameron Dwyer

Office 365, SharePoint, Azure, OnePlace Solutions & Life's Other Little Wonders


Me and My doings!

Share SharePoint Points !

By Mohit Vashishtha

Jimmy Janlén "Den Scrummande Konsulten"

Erfarenheter, synpunkter och raljerande om Scrum från Jimmy Janlén

Aryan Nava

DevOps, Cloud and Blockchain Consultant


SharePoint for everyone


Ryan Dennis is a SharePoint Solution Architect with a passion for SharePoint and PowerShell

SharePoint 2020

The Vision for a Future of Clarity

Aharoni in Unicode

Treacle tarts for great justice

... And All That JS

JavaScript, Web Apps and SharePoint


Mostly what I know and share about...