Wednesday, July 10, 2018 - Debug by numbers | Anny G's blog

Wednesday, July 10, 2018 - Debug by numbers

Written on Jul 10, 2018

9:05 am

While trying to search how to access the ‘opener’ property from my tests, to ensure it hasn’t been set, I came across this test file dom/tests/browser/browser_noopener.js. Were my efforts vain? We will find out after I figure out how to run the actual test. So far it has been hanging - the tests run and afterwards the browser window just stays open and no status of the tests is visible. For now I need to move on to a different bug.

2:00 pm

I need to figure out how to access the opener setting on a newly opened tab. I want to retrieve a contentWindow but for some reason after I retrieve the tab, the following does not work tab.linkedBrowser.contentWindow.

A bit later

I searched for .opener in the dom/tests/browser/browser_noopener.js file and realized I can access the window object if I spawn a new content task in the following way

    let noopenerTab = gBrowser.tabs[numTabs - 1];
    await ContentTask.spawn(noopenerTab.linkedBrowser, null, async () => {
        ok(!content.window.opener, "Opener should not have been set");
    });