Hi developers,
I would like to know if it is normal for the "chrome.offscreen.createDocument" method
does not throw any error when trying to open a document that does not exist (i.e. if a incorrect URL is indicated)
Example:
chrome.offscreen.createDocument({
url: 'osd2.html', /* osd2.html is an incorrect url */
reasons: ["DOM_PARSER"],
justification: 'dummy'
}, _ => {
console.log('Error: ', chrome.runtime.lastError)
})First time I run it in console I can read:
Error: undefinedand I don't see any documents in the "Inspect views" list
If I run it a second time I can instead read:
Error {message: 'Only a single offscreen document may be created.'}
Wrapping the creation inside a try-catch the behavior is similar.
No error is generated at first time
It would seem that a ghost document is created the first time.
Don't you find it a little strange?
TIA