Bug 111688 - Web Inspector: Details of InjectedScript function call shall not be linkified in Timeline panel.
Summary: Web Inspector: Details of InjectedScript function call shall not be linkified...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-06 23:01 PST by pdeng6
Modified: 2014-12-12 13:28 PST (History)
10 users (show)

See Also:


Attachments
Link of InjectedScript function call (68.68 KB, image/png)
2013-03-06 23:03 PST, pdeng6
no flags Details
error page that the invalid link lead to (54.29 KB, image/png)
2013-03-06 23:04 PST, pdeng6
no flags Details
Patch (16.84 KB, patch)
2013-03-06 23:07 PST, pdeng6
no flags Details | Formatted Diff | Diff
Patch (4.19 KB, patch)
2013-03-11 23:30 PDT, pdeng6
no flags Details | Formatted Diff | Diff
Patch (4.00 KB, patch)
2013-03-12 18:56 PDT, pdeng6
vsevik: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description pdeng6 2013-03-06 23:01:45 PST
Currently, details of InjectedScript function call is linkified, but actually, no valid resource provided for it, see attachment 1.
when user click the link, "This page is not available" will pop up, see attachement 2.
I suggest remove the link and line number in this case :)

Thanks
Pan
Comment 1 pdeng6 2013-03-06 23:03:29 PST
Created attachment 191925 [details]
Link of InjectedScript function call
Comment 2 pdeng6 2013-03-06 23:04:58 PST
Created attachment 191926 [details]
error page that the invalid link lead to
Comment 3 pdeng6 2013-03-06 23:07:35 PST
Created attachment 191927 [details]
Patch
Comment 4 Pavel Feldman 2013-03-07 01:30:59 PST
Comment on attachment 191927 [details]
Patch

I think this edge case is to minor to special case / plumb callFromInjectedScript with it.
Comment 5 pdeng6 2013-03-11 23:30:11 PDT
Created attachment 192652 [details]
Patch
Comment 6 pdeng6 2013-03-11 23:35:30 PDT
(In reply to comment #4)
> (From update of attachment 191927 [details])
> I think this edge case is to minor to special case / plumb callFromInjectedScript with it.

yes, to avoid plumb things, I suggest only make funcitonCall link for valid script url.
It also solve the invalid link "undefined:1" besides "InjectedScript:1" :)

Thanks!
Pan
Comment 7 Alexander Pavlov (apavlov) 2013-03-12 04:28:01 PDT
Comment on attachment 192652 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=192652&action=review

> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:1127
> +     * @return {true|false}

{boolean}

> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:1133
> +                var parsedURL = new WebInspector.ParsedURL(this.scriptName);

You can make use of String.prototype.asParsedURL found in ParsedURL.js and rewrite this as:

this._validScriptLocation = !!this.scriptName.asParsedURL();

> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:1135
> +            } else {

Please remove curly braces around a single-line block.

> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:1140
> +        return  this._validScriptLocation;

Extraneous whitespace after "return"
Comment 8 pdeng6 2013-03-12 18:56:08 PDT
Created attachment 192854 [details]
Patch
Comment 9 pdeng6 2013-03-12 18:58:25 PDT
(In reply to comment #7)
> (From update of attachment 192652 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=192652&action=review
> 
> > Source/WebCore/inspector/front-end/TimelinePresentationModel.js:1127
> > +     * @return {true|false}
> 
> {boolean}
> 
Done

> > Source/WebCore/inspector/front-end/TimelinePresentationModel.js:1133
> > +                var parsedURL = new WebInspector.ParsedURL(this.scriptName);
> 
> You can make use of String.prototype.asParsedURL found in ParsedURL.js and rewrite this as:
> 
> this._validScriptLocation = !!this.scriptName.asParsedURL();
> 
Done, thanks a lot for guidance!

> > Source/WebCore/inspector/front-end/TimelinePresentationModel.js:1135
> > +            } else {
> 
> Please remove curly braces around a single-line block.
> 
Done

> > Source/WebCore/inspector/front-end/TimelinePresentationModel.js:1140
> > +        return  this._validScriptLocation;
> 
> Extraneous whitespace after "return"
Done,

Thanks!
Pan
Comment 10 pdeng6 2013-03-15 00:00:34 PDT
Comment on attachment 192854 [details]
Patch

@apavlov, could you please help review this patch?

thanks
Pan
Comment 11 Vsevolod Vlasov 2013-03-15 01:34:51 PDT
Comment on attachment 192854 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=192854&action=review

> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:1132
> +            this._validScriptLocation = this.scriptName ? !!this.scriptName.asParsedURL() : false;

I think it's possible that a script with the name that could not be correctly parsed can still be correctly linkified (think sourceURL).
Such false negative would be a much worse issue than current false positive behavior.
Comment 12 Brian Burg 2014-12-12 13:28:58 PST
Closing as invalid, as this bug pertains to the old inspector UI and/or its tests.
Please file a new bug (https://www.webkit.org/new-inspector-bug) if the bug/feature/issue is still relevant to WebKit trunk.