Bug 170446
| Summary: | Exception when trying to get self.crypto.webkitSubtle in WebWorker | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Yury Strozhevsky <yury.stro> |
| Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED WONTFIX | ||
| Severity: | Normal | CC: | ap, bfulgham, jiewen_tan |
| Priority: | P2 | ||
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Yury Strozhevsky
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
self.crypto.webkitSubtle wasn't supported in workers in the past, so this is not a regression. Please use non-deprecated API.
Yury Strozhevsky
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
Getters are allowed to raise exceptions, and often do. This is expected behavior for crypto.webkitSubtle.
Jiewen Tan
(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
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.