<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>170446</bug_id>
          
          <creation_ts>2017-04-04 04:00:45 -0700</creation_ts>
          <short_desc>Exception when trying to get self.crypto.webkitSubtle in WebWorker</short_desc>
          <delta_ts>2017-04-06 02:39:15 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yury Strozhevsky">yury.stro</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>jiewen_tan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1294014</commentid>
    <comment_count>0</comment_count>
    <who name="Yury Strozhevsky">yury.stro</who>
    <bug_when>2017-04-04 04:00:45 -0700</bug_when>
    <thetext>I am trying to use WebCrypto API inside WebWorker. When I try to even just get value of &quot;self.crypto.webkitSubtle&quot; I got error &quot;Operation is not supported&quot;. When I get value of &quot;self.crypto.subtle&quot; everithing is fine. I do know that &quot;webkitSubtle&quot; is deprecated, but I do expect to have just a warning here, not an expection.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1294293</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2017-04-04 17:11:00 -0700</bug_when>
    <thetext>self.crypto.webkitSubtle wasn&apos;t supported in workers in the past, so this is not a regression. Please use non-deprecated API.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1294399</commentid>
    <comment_count>2</comment_count>
    <who name="Yury Strozhevsky">yury.stro</who>
    <bug_when>2017-04-04 23:15:03 -0700</bug_when>
    <thetext>Alexey, seems you misunderstand the issue. I have an exception during getting a value of existing property for &quot;self.crypto&quot;. It is not during using the webkitSubtle, but just while getting value. 

So, even if it &quot;wasn&apos;t supported in the past&quot; 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(&quot;webkitSubtle&quot; in self.crypto)
{
	subtleObject = self.crypto.webkitSubtle;
	engineName = &quot;safari&quot;;
}

So, please fix the bug - it is a real bug. And I do believe it is easy to fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1294407</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2017-04-04 23:34:43 -0700</bug_when>
    <thetext>Getters are allowed to raise exceptions, and often do. This is expected behavior for crypto.webkitSubtle.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1294566</commentid>
    <comment_count>4</comment_count>
    <who name="Jiewen Tan">jiewen_tan</who>
    <bug_when>2017-04-05 11:04:00 -0700</bug_when>
    <thetext>(In reply to Yury Strozhevsky from comment #0)
&gt; I am trying to use WebCrypto API inside WebWorker. When I try to even just
&gt; get value of &quot;self.crypto.webkitSubtle&quot; I got error &quot;Operation is not
&gt; supported&quot;. When I get value of &quot;self.crypto.subtle&quot; everithing is fine. I
&gt; do know that &quot;webkitSubtle&quot; is deprecated, but I do expect to have just a
&gt; warning here, not an expection.

Please use our new api self.crypto.subtle for any future development. Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1294835</commentid>
    <comment_count>5</comment_count>
    <who name="Yury Strozhevsky">yury.stro</who>
    <bug_when>2017-04-06 02:39:15 -0700</bug_when>
    <thetext>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.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>