<?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>85709</bug_id>
          
          <creation_ts>2012-05-05 07:22:47 -0700</creation_ts>
          <short_desc>Web Inspector: [JSC] support JS execution in the context of an isolated world</short_desc>
          <delta_ts>2012-07-05 02:18:34 -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>Web Inspector (Deprecated)</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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>
          <dependson>85612</dependson>
    
    <dependson>90594</dependson>
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Yury Semikhatsky">yurys</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>apavlov</cc>
    
    <cc>barraclough</cc>
    
    <cc>bweinstein</cc>
    
    <cc>charles.wei</cc>
    
    <cc>ggaren</cc>
    
    <cc>joepeck</cc>
    
    <cc>keishi</cc>
    
    <cc>loislo</cc>
    
    <cc>mark.lam</cc>
    
    <cc>oliver</cc>
    
    <cc>PeterHWang</cc>
    
    <cc>pfeldman</cc>
    
    <cc>pmuellr</cc>
    
    <cc>rik</cc>
    
    <cc>timothy</cc>
    
    <cc>webkit.review.bot</cc>
    
    <cc>yurys</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>616960</commentid>
    <comment_count>0</comment_count>
    <who name="Yury Semikhatsky">yurys</who>
    <bug_when>2012-05-05 07:22:47 -0700</bug_when>
    <thetext>Web Inspector should allow console evals in isolated worlds.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>617028</commentid>
    <comment_count>1</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2012-05-05 10:19:27 -0700</bug_when>
    <thetext>Can you explain what this actually means?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>617083</commentid>
    <comment_count>2</comment_count>
    <who name="Yury Semikhatsky">yurys</who>
    <bug_when>2012-05-05 23:37:49 -0700</bug_when>
    <thetext>After https://bugs.webkit.org/show_bug.cgi?id=85612 is landed it should be possible to select exact JS context in which snippets entered in Web Inspector console should be executed. At the moment it is only possible to select a frame and evaluation will be performed in the main world context of that. This bug is about adding an option to specify exact isolated world in which to perform the evaluation.  Most of the stuff will be added once fix for 85612 is landed and the only remaining part will be to provide information about non-main-world contexts from JS bindings to the inspector code. I was going to take a look at this when https://bugs.webkit.org/show_bug.cgi?id=85612 is fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>630130</commentid>
    <comment_count>3</comment_count>
    <who name="Yury Semikhatsky">yurys</who>
    <bug_when>2012-05-22 02:30:29 -0700</bug_when>
    <thetext>I&apos;m trying to figure out what can be used to discriminate between different DOMWrapperWorlds on a given Frame. In V8 bindings each isolated context has its own security origin which is used in the inspector front-end as the context name. I don&apos;t see similar API in the JS bindings and it looks to me that in case of JSC all isolated contexts will have same security origin as the DOMWindow. Can someone familiar with the JS bindings enlighten me on this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>630627</commentid>
    <comment_count>4</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2012-05-22 11:58:02 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; I&apos;m trying to figure out what can be used to discriminate between different DOMWrapperWorlds on a given Frame.

Inside WebCore, we use a DOMWrapperWorld pointer. See WebCore::ScriptController::evaluateInWorld().

To map the current execution context to the current DOMWrapperWorld, we use WebCore::currentWorld():

inline DOMWrapperWorld* currentWorld(JSC::ExecState* exec)
{
    return JSC::jsCast&lt;JSDOMGlobalObject*&gt;(exec-&gt;lexicalGlobalObject())-&gt;world();
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>631238</commentid>
    <comment_count>5</comment_count>
    <who name="Yury Semikhatsky">yurys</who>
    <bug_when>2012-05-22 22:53:59 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; I&apos;m trying to figure out what can be used to discriminate between different DOMWrapperWorlds on a given Frame.
&gt; 
&gt; Inside WebCore, we use a DOMWrapperWorld pointer.
It is still not clear to me how we can represent the world to the user in the inspector UI. In V8 bindings each V8IsolatedContext (a counterpart of JSDOMWindowShell in case of non-main world as I understand) will have its own security origin which is basically a URL of the extension which created that context. In the inspector UI we have a combobox with URLs of all the extensions that have content scripts in the selected Frame. The URLs are quite convenient for specifying a context where the console evaluation should happen. The problem is that DOMWrapperWorld doesn&apos;t provide access to such URL. I didn&apos;t find a good identifier(which could be used in the inspector UI) on JSDOMWindowShell either.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>631262</commentid>
    <comment_count>6</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2012-05-22 23:17:21 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; In the inspector UI we have a combobox with URLs of all the extensions that have content scripts in the selected Frame.

Which URL do you use? The content script URL? Global page URL? Something else?

In WebKit, DOMWrapperWorld doesn&apos;t require an associated URL or domain, so it doesn&apos;t have one to display. Perhaps you could infer a URL for display simply by recording the first URL passed to ScriptController::evaluateInWorld() for any give DOMWrapperWorld.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>631277</commentid>
    <comment_count>7</comment_count>
    <who name="Yury Semikhatsky">yurys</who>
    <bug_when>2012-05-22 23:39:32 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; (In reply to comment #5)
&gt; &gt; In the inspector UI we have a combobox with URLs of all the extensions that have content scripts in the selected Frame.
&gt; 
&gt; Which URL do you use? The content script URL? Global page URL? Something else?
&gt; 
The URL of an extension that created the context and will evaluate all content scripts in it. As I understand this URL is used for security checks when the content script sends XHR for example(a counterpart of DOMWindow::securityOrigin for isolated world).

&gt; In WebKit, DOMWrapperWorld doesn&apos;t require an associated URL or domain, so it doesn&apos;t have one to display. Perhaps you could infer a URL for display simply by recording the first URL passed to ScriptController::evaluateInWorld() for any give DOMWrapperWorld.
This sounds reasonable, given that DOMWrapperWorld doesn&apos;t require an associated URL or domain I don&apos;t think we can come up with a better solution in this case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>657483</commentid>
    <comment_count>8</comment_count>
    <who name="Peter Wang">PeterHWang</who>
    <bug_when>2012-06-26 03:48:10 -0700</bug_when>
    <thetext>Is someone working on it now? If not, I&apos;d like to have a try.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>659593</commentid>
    <comment_count>9</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2012-06-28 10:20:49 -0700</bug_when>
    <thetext>I don&apos;t think anyone is.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>662636</commentid>
    <comment_count>10</comment_count>
      <attachid>150707</attachid>
    <who name="Peter Wang">PeterHWang</who>
    <bug_when>2012-07-03 19:04:23 -0700</bug_when>
    <thetext>Created attachment 150707
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>663346</commentid>
    <comment_count>11</comment_count>
      <attachid>150707</attachid>
    <who name="Gavin Barraclough">barraclough</who>
    <bug_when>2012-07-04 23:52:39 -0700</bug_when>
    <thetext>Comment on attachment 150707
Patch

Looks good to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>663361</commentid>
    <comment_count>12</comment_count>
      <attachid>150707</attachid>
    <who name="Leo Yang">leo.yang</who>
    <bug_when>2012-07-05 00:21:50 -0700</bug_when>
    <thetext>Comment on attachment 150707
Patch

Sending to cq.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>663382</commentid>
    <comment_count>13</comment_count>
      <attachid>150707</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-07-05 01:20:05 -0700</bug_when>
    <thetext>Comment on attachment 150707
Patch

Clearing flags on attachment: 150707

Committed r121891: &lt;http://trac.webkit.org/changeset/121891&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>663383</commentid>
    <comment_count>14</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-07-05 01:20:12 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>150707</attachid>
            <date>2012-07-03 19:04:23 -0700</date>
            <delta_ts>2012-07-05 01:20:05 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-85709-20120704100420.patch</filename>
            <type>text/plain</type>
            <size>1976</size>
            <attacher name="Peter Wang">PeterHWang</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTIxNzI3CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggMjcyZDZiN2E1YjkyNzgz
MjI0MGM3ZWU0MWRmNmM1MjNiNDUxZTBlMy4uZWQ5Y2QwODg2YjYyMmUzNzNlYjU2MjJlYzc4ZGZm
ZjY1Mzc4MDVkNyAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE2IEBACisyMDEyLTA3LTAzICBQZXRl
ciBXYW5nICA8cGV0ZXIud2FuZ0B0b3JjaG1vYmlsZS5jb20uY24+CisKKyAgICAgICAgV2ViIElu
c3BlY3RvcjogW0pTQ10gc3V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