There is a such thing as "background page" in Chrome extensions. It allows to add a kind of run-once code for extension which also sits resident, and then access it from other pages like this:
var backPage = chrome.extension.getBackgroundPage();
The question is, is there something alike available for Internet Explorer addons?
Based on our experience in extensions for IE we found no way to emulate a Chrome-like background page behaviour in IE using JavaScript.