RESOLVED WONTFIX 170446
Exception when trying to get self.crypto.webkitSubtle in WebWorker
https://bugs.webkit.org/show_bug.cgi?id=170446
Summary Exception when trying to get self.crypto.webkitSubtle in WebWorker
Yury Strozhevsky
Reported 2017-04-04 04:00:45 PDT
I am trying to use WebCrypto API inside WebWorker. When I try to even just get value of "self.crypto.webkitSubtle" I got error "Operation is not supported". When I get value of "self.crypto.subtle" everithing is fine. I do know that "webkitSubtle" is deprecated, but I do expect to have just a warning here, not an expection.
Attachments
Alexey Proskuryakov
Comment 1 2017-04-04 17:11:00 PDT
self.crypto.webkitSubtle wasn't supported in workers in the past, so this is not a regression. Please use non-deprecated API.
Yury Strozhevsky
Comment 2 2017-04-04 23:15:03 PDT
Alexey, seems you misunderstand the issue. I have an exception during getting a value of existing property for "self.crypto". It is not during using the webkitSubtle, but just while getting value. So, even if it "wasn't supported in the past" this is a bug. No it is a BUG - you have a property of standard system object but no one could even read the property value without exception. In fact I do not have old Safari for testing, but I had Safari working with this code inside WebWroker (it is from PKI.js library, https://github.com/PeculiarVentures/PKI.js/blob/master/src/common.js#L46): if("webkitSubtle" in self.crypto) { subtleObject = self.crypto.webkitSubtle; engineName = "safari"; } So, please fix the bug - it is a real bug. And I do believe it is easy to fix.
Alexey Proskuryakov
Comment 3 2017-04-04 23:34:43 PDT
Getters are allowed to raise exceptions, and often do. This is expected behavior for crypto.webkitSubtle.
Jiewen Tan
Comment 4 2017-04-05 11:04:00 PDT
(In reply to Yury Strozhevsky from comment #0) > I am trying to use WebCrypto API inside WebWorker. When I try to even just > get value of "self.crypto.webkitSubtle" I got error "Operation is not > supported". When I get value of "self.crypto.subtle" everithing is fine. I > do know that "webkitSubtle" is deprecated, but I do expect to have just a > warning here, not an expection. Please use our new api self.crypto.subtle for any future development. Thanks.
Yury Strozhevsky
Comment 5 2017-04-06 02:39:15 PDT
I made a comment in this bug: https://bugs.webkit.org/show_bug.cgi?id=165913 Hope someone really solved the bug would ask there and clarify situation.
Note You need to log in before you can comment on or make changes to this bug.