bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] Wget not finding image references in javascript source


From: Zane Staggs
Subject: Re: [Bug-wget] Wget not finding image references in javascript source
Date: Thu, 3 Mar 2016 12:59:14 -0800

Sounds reasonable Darshit thanks for the explanation.  Rather than
actually parsing javascript (or use a headless browser etc) I was
thinking wget could use a regex for the simplest case of an image with
the jpg/png/gif extension embedded in javascript strings.  But I do
realize that there is overhead to that and there are many edge cases
to how a javascript string might be built dynamically so it may be
just too much risk to even try to do that but maybe not if it's only
for the specific case of a valid absolute/relative path to an image.

-- Zane


On Mon, Feb 29, 2016 at 10:59 PM, Darshit Shah <address@hidden> wrote:
> Hi Zane,
>
> The question of supporting links and images emebdded via javascript props up
> fairly often. JS is a dynamic scripting language and the code path taken
> depends on the user's interaction with the page. To simulate this, we would
> need a full JS engine inside of Wget. Apart from being large and clumsy this
> would also be impossible for us to maintain. As a result, we do not and have
> no plans to support parsing JS code in Wget in the near future.
>
> If you have any ideas that would help implement this without needing a full
> JS engine, do let us know. We'd be interested in hearing and evaluating new
> options.
>
> On 02/29, Zane Staggs wrote:
>>
>> It seems wget ignores image paths that exist in javascript source like
>> in a simple path string like "/path/to/my/image.jpg".  I realize it's
>> probably not easy to do parse every js string for an image path but
>> wondering if there are ways to make it work or plans to implement it.
>> I got around it for now by creating a dummy hidden img element with
>> the src so wget could find it in the dom.  Thanks.
>>
>
> --
> Thanking You,
> Darshit Shah



reply via email to

[Prev in Thread] Current Thread [Next in Thread]