<?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>118055</bug_id>
          
          <creation_ts>2013-06-26 05:22:48 -0700</creation_ts>
          <short_desc>[GTK] [WK2] Check value of WEBKIT_INJECTED_BUNDLE_PATH</short_desc>
          <delta_ts>2013-06-27 01:49:52 -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>WebKitGTK</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</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>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Alberto Garcia">berto</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cgarcia</cc>
    
    <cc>commit-queue</cc>
    
    <cc>gustavo</cc>
    
    <cc>mrobinson</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>903648</commentid>
    <comment_count>0</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2013-06-26 05:22:48 -0700</bug_when>
    <thetext>If the WEBKIT_INJECTED_BUNDLE_PATH if exists, then the injected bundle
path is taken from there and the system directory is completely
ignored. This is a problem if the custom directory does not exist.

The MiniBrowser for example has WEBKIT_INJECTED_BUNDLE_PATH hardcoded
to $(top_builddir)/.libs. This means that it cannot be distributed
since it won&apos;t work outside the build tree (unless we manually
override that variable).

Although maybe being distributable is not the purpose of the
MiniBrowser, there&apos;s also no reason not to make it work if webkit is
properly installed in the system.

One solution is to fall back to the system directory if the other one
does not exist, which is also what we do with the web inspector in
WebInspectorProxyGtk.cpp.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>903650</commentid>
    <comment_count>1</comment_count>
      <attachid>205477</attachid>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2013-06-26 05:31:49 -0700</bug_when>
    <thetext>Created attachment 205477
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>903651</commentid>
    <comment_count>2</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-06-26 05:33:03 -0700</bug_when>
    <thetext>Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>903683</commentid>
    <comment_count>3</comment_count>
      <attachid>205477</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2013-06-26 06:34:19 -0700</bug_when>
    <thetext>Comment on attachment 205477
Patch

I think providing an invalid directory in WEBKIT_INJECTED_BUNDLE_PATH is an error of the one who set the variable. This env var is only useful for internal tests and tools, users of the WebKit2GTK+ API should use web extensions instead. So, I&apos;m not sure it&apos;s a good idea to add a blocking I/O call here. On the other hand, the check is only done when the env var contains something (this shouldn&apos;t happen in most of the cases), so I guess it&apos;s harmless. I wonder whether we should return NULL and/or print an error in stderr in that case instead of falling back to system directory. It can be very confusing if I make a typographic error and the installed injected bundle is used silently. What do you think?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>904098</commentid>
    <comment_count>4</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2013-06-27 01:09:06 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; I think providing an invalid directory in
&gt; WEBKIT_INJECTED_BUNDLE_PATH is an error of the one who set the
&gt; variable.

I was wondering how to make MiniBrowser work outside the build tree. I
know it&apos;s just an internal tool, but I guess it still can be useful
(of course if a distributor wants to ship it they can easily remove
the hardcoded WEBKIT_INJECTED_BUNDLE_PATH value).

It&apos;s worth noting that the behavior in the case of
WEBKIT_INSPECTOR_PATH is different (we silently fall back to the
system directory if the other one doesn&apos;t exist). So I&apos;d say we should
make them the same for the sake of consistency at least.

I don&apos;t have a strong opinion in this case since it&apos;s really not so
important, but printing and message to stderr sounds good to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>904103</commentid>
    <comment_count>5</comment_count>
      <attachid>205477</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-06-27 01:49:50 -0700</bug_when>
    <thetext>Comment on attachment 205477
Patch

Clearing flags on attachment: 205477

Committed r152084: &lt;http://trac.webkit.org/changeset/152084&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>904104</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-06-27 01:49:52 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>205477</attachid>
            <date>2013-06-26 05:31:49 -0700</date>
            <delta_ts>2013-06-27 01:49:50 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>118055.diff</filename>
            <type>text/plain</type>
            <size>1599</size>
            <attacher name="Alberto Garcia">berto</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJLaXQyL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJLaXQyL0No
YW5nZUxvZwppbmRleCA4YTQ2NjAzLi5hNTQ4NWVmIDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViS2l0
Mi9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYktpdDIvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTgg
QEAKKzIwMTMtMDYtMjYgIEFsYmVydG8g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