Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var g_pfnCreateEngine1 = null;
- // sample code which causes one container to not be released in FF 10
- function SampleCode1(domdoc)
- {
- if (!g_pfnCreateEngine1)
- {
- var strJS = "function _SampleEvalFnc(d){return null;}"
- eval (strJS);
- g_pfnCreateEngine1 = _SampleEvalFnc;
- }
- // Uncommenting the next line causes the last compartment to be released
- // g_pfnCreateEngine1 = null;
- }
- var oSAPlg = {
- handleEvent : function(e) {
- try {
- switch(e.type) {
- case "DOMContentLoaded":
- this.onDocumentComplete(e);
- break;
- case "load":
- this.onStartup();
- break;
- default:
- break;
- };
- } catch(e) {
- }
- },
- // The 'load' handler. Subscribes us to 'DOMContentLoaded' events.
- onStartup: function() {
- var appcontent = document.getElementById("appcontent"); // browser
- if(appcontent) {
- appcontent.addEventListener("DOMContentLoaded", this, false);
- }
- },
- // The 'DOMContentLoaded' handler. Demonstrates compartment leak.
- onDocumentComplete : function(e) {
- var doc = e.originalTarget;
- if (doc instanceof HTMLDocument) {
- var domdoc = doc;
- try
- {
- // Only run sample code on mcafee.com
- if(domdoc && domdoc.location
- && domdoc.location.href
- && domdoc.location.href.indexOf("mcafee.com", 0) != -1)
- {
- SampleCode1(domdoc);
- }
- return;
- }
- catch(e)
- {
- alert("annotate: " + e.message);
- }
- }
- }
- };
- // Entry point
- window.addEventListener("load", oSAPlg, false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement