I'm trying to develop a simple addon using the Sessions API, so I wanted to play around a bit with the JS in the Browser Toolbox first. I have set devtools.chrome.enable… (閱讀更多)
I'm trying to develop a simple addon using the Sessions API, so I wanted to play around a bit with the JS in the Browser Toolbox first. I have set devtools.chrome.enabled to true and pressed Ctrl+Shift+J to open the browser console. I'm able to run some JS (example: console.log("Hello world!") works as expected), but when I try to run something like sessions.getRecentlyClosed(), I get the following error message:
Uncaught ReferenceError: sessions is not defined
<anonymous> debugger eval code:1
I tried browser.sessions.getRecentlyClosed() with the same error message about "browser.sessions" not being defined. Anyone know why this is happening and how to fix it, or how to correctly import the Sessions API if that's what's needed?