offscreen.createDocument don't throw any error when trying to open an incorrect URL

304 views
Skip to first unread message

Roberto Oneto

unread,
Mar 19, 2024, 5:56:14 AMMar 19
to Chromium Extensions
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: undefined
and 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

Jackie Han

unread,
Mar 19, 2024, 9:38:16 AMMar 19
to Roberto Oneto, Chromium Extensions
Of course, it is a bug.

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/167320f7-0597-45ac-a52a-1fee94ff8608n%40chromium.org.
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Roberto Oneto

unread,
Mar 23, 2024, 4:52:50 AMMar 23
to Chromium Extensions, Jackie Han, Chromium Extensions, Roberto Oneto
I post again because the previous one it was inexplicably removed (not by myself).

A bug report has been openedbug-report-link

Roberto Oneto

unread,
May 24, 2024, 5:00:04 AMMay 24
to Chromium Extensions, Roberto Oneto, Jackie Han, Chromium Extensions
That bug has been fixed in chrome 126.
Thank the team

Reply all
Reply to author
Forward
0 new messages