Re: [webkit-dev] How to let webkit to be able to load local image file in html content?

2009-05-14 Thread Holger Freyther
On Thursday 14 May 2009 07:14:18 Jan Alonzo wrote:
 Hi  james,

 can you please file a bug against the WebKitGtk component at
 http://bugs.webkit.org. I don't think that's correct.

It is correct. You define the SecurityOrigin (we have a class with that name) 
and you want to load something from a different context. Think of a WebPage 
trying to get file:///etc/passwd. This is only allowed if the page itself has 
been loaded from file...



z.
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] How to let webkit to be able to load local image file in html content?

2009-05-14 Thread Zhe Su
I just found that setting base_uri to file:// can't actually solve the
problem. Though it allows loading local image file in a simple html content,
I found that using local image file in css may still not work. It looks not
like a correct behavior.

Regards
James Su

On Thu, May 14, 2009 at 3:37 PM, Holger Freyther ze...@selfish.org wrote:

 On Thursday 14 May 2009 07:14:18 Jan Alonzo wrote:
  Hi  james,
 
  can you please file a bug against the WebKitGtk component at
  http://bugs.webkit.org. I don't think that's correct.

 It is correct. You define the SecurityOrigin (we have a class with that
 name)
 and you want to load something from a different context. Think of a WebPage
 trying to get file:///etc/passwd. This is only allowed if the page itself
 has
 been loaded from file...



z.
 ___
 webkit-dev mailing list
 webkit-dev@lists.webkit.org
 http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] How to let webkit to be able to load local image file in html content?

2009-05-14 Thread Jan Alonzo
On Thu, May 14, 2009 at 5:37 PM, Holger Freyther ze...@selfish.org wrote:

 On Thursday 14 May 2009 07:14:18 Jan Alonzo wrote:
  Hi  james,
 
  can you please file a bug against the WebKitGtk component at
  http://bugs.webkit.org. I don't think that's correct.

 It is correct. You define the SecurityOrigin (we have a class with that
 name)
 and you want to load something from a different context. Think of a WebPage
 trying to get file:///etc/passwd. This is only allowed if the page itself
 has
 been loaded from file..


Hi Holger

I was pointing at our documentation for that function which states that
base_uri is used as the base URI for relative locations. Since the resource
is already absolute, i think it should be ok to pass NULL here. And passing
NULL doesn't work in this case

Jan
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] How to let webkit to be able to load local image file in html content?

2009-05-13 Thread tonikitoo (Antonio Gomes)
It sounds like we can be misusing the base_url parameter. could you
paste how you are calling the method (parameters and so) and a snippet
of the local html file.

On Wed, May 13, 2009 at 6:58 AM, Zhe Su james...@gmail.com wrote:
 Hi,
   When I call webkit_web_view_load_html_string() to load a html content into
 a webkitview, webkit always refuses to load local files (image) referred in
 the html content. Is it possible to work around this behavior and let webkit
 load local files?

-- 
--Antonio Gomes
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] How to let webkit to be able to load local image file in html content?

2009-05-13 Thread Zhe Su
Attached is a simple test program. When running the program, following error
occurred:

console message:  @0: Not allowed to load local resource:
file:///usr/share/pixmaps/elisa.svg

But if you save the html content into a file and load it with GtkLauncher,
then it's ok.

Regards
James Su

On Thu, May 14, 2009 at 12:26 AM, tonikitoo (Antonio Gomes) 
toniki...@gmail.com wrote:

 It sounds like we can be misusing the base_url parameter. could you
 paste how you are calling the method (parameters and so) and a snippet
 of the local html file.

 On Wed, May 13, 2009 at 6:58 AM, Zhe Su james...@gmail.com wrote:
  Hi,
When I call webkit_web_view_load_html_string() to load a html content
 into
  a webkitview, webkit always refuses to load local files (image) referred
 in
  the html content. Is it possible to work around this behavior and let
 webkit
  load local files?

 --
 --Antonio Gomes

#includegtk/gtk.h
#include webkit/webkit.h

static const char kHtml[] =
html\n
  body\n
img src=\file:///usr/share/pixmaps/elisa.svg\/\n
  /body\n
/html;

int main(int argc, char *argv[]) {
  GtkWidget *window;
  GtkWidget *web_view;
  gtk_init(argc, argv);
  g_thread_init(NULL);

  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  web_view = GTK_WIDGET(webkit_web_view_new());

  gtk_container_add(GTK_CONTAINER(window), web_view);
  gtk_widget_show_all(window);

  webkit_web_view_load_html_string(WEBKIT_WEB_VIEW(web_view), kHtml, NULL);
  gtk_main();
}
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] How to let webkit to be able to load local image file in html content?

2009-05-13 Thread Zhe Su
Just found that the problem is gone when the base_uri parameter is set to
file:// instead of NULL. Is it a correct way?

Regards
James Su

On Thu, May 14, 2009 at 10:40 AM, Zhe Su james...@gmail.com wrote:

 Attached is a simple test program. When running the program, following
 error occurred:

 console message:  @0: Not allowed to load local resource:
 file:///usr/share/pixmaps/elisa.svg

 But if you save the html content into a file and load it with GtkLauncher,
 then it's ok.

 Regards
 James Su


 On Thu, May 14, 2009 at 12:26 AM, tonikitoo (Antonio Gomes) 
 toniki...@gmail.com wrote:

 It sounds like we can be misusing the base_url parameter. could you
 paste how you are calling the method (parameters and so) and a snippet
 of the local html file.

 On Wed, May 13, 2009 at 6:58 AM, Zhe Su james...@gmail.com wrote:
  Hi,
When I call webkit_web_view_load_html_string() to load a html content
 into
  a webkitview, webkit always refuses to load local files (image) referred
 in
  the html content. Is it possible to work around this behavior and let
 webkit
  load local files?

 --
 --Antonio Gomes



___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] How to let webkit to be able to load local image file in html content?

2009-05-13 Thread Zhe Su
Then what's correct behavior?

On 5/14/09, Jan Alonzo jan.li...@gmail.com wrote:
 Hi  james,

 can you please file a bug against the WebKitGtk component at
 http://bugs.webkit.org. I don't think that's correct.

 Thanks,
 Jan

 On 5/14/09, Zhe Su james...@gmail.com wrote:
 Just found that the problem is gone when the base_uri parameter is set to
 file:// instead of NULL. Is it a correct way?

 Regards
 James Su

 On Thu, May 14, 2009 at 10:40 AM, Zhe Su james...@gmail.com wrote:

 Attached is a simple test program. When running the program, following
 error occurred:

 console message:  @0: Not allowed to load local resource:
 file:///usr/share/pixmaps/elisa.svg

 But if you save the html content into a file and load it with
 GtkLauncher,
 then it's ok.

 Regards
 James Su


 On Thu, May 14, 2009 at 12:26 AM, tonikitoo (Antonio Gomes) 
 toniki...@gmail.com wrote:

 It sounds like we can be misusing the base_url parameter. could you
 paste how you are calling the method (parameters and so) and a snippet
 of the local html file.

 On Wed, May 13, 2009 at 6:58 AM, Zhe Su james...@gmail.com wrote:
  Hi,
When I call webkit_web_view_load_html_string() to load a html
  content
 into
  a webkitview, webkit always refuses to load local files (image)
  referred
 in
  the html content. Is it possible to work around this behavior and let
 webkit
  load local files?

 --
 --Antonio Gomes





___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev