Martii / greasemonkey

Greasemonkey is a user script manager for Firefox.
http://userscripts.org/users/marti
Other
7 stars 2 forks source link

Multiple @icon picks last value #4

Closed Martii closed 13 years ago

Martii commented 13 years ago

When using @icon more than once there is a change in behavior from prior single use metadata block keys always picking the first encountered value

e.g.

...
// @icon http://example.com/usethis1.png
// @icon http://example.com/usethis2.png
...

picks usethis2.png

Is this the desired behavior?

Martii commented 13 years ago

Reported upstream greasemonkey#1233

Martii commented 13 years ago

Comment upstream to arantius at http://github.com/greasemonkey/greasemonkey/issues/1233#issuecomment-992563

Legacy behavior of this is shown on Userscripts.org (USO) at this script with the resulting screen shot.

Since GM 0.8.6 didn't collect some of these stats it is presumed by USO and many ScriptWrights including some of the veterans on USO throughout the years to be FIFO instead of the current interpretation of LIFO... however if this is the intended behavior for 0.9.x+ then I would have a concern about multiple @icon values promoting DDoS attacks by queuing up potentially hundreds of them perhaps in between valid, legitimate code on an unsuspecting User. This could effectively tie up GM's script downloader for a very long time.

I'll email Jesse and see if he's available to make the switch assuming that GM wants to follow this newer behavior but the main objective is to determine if GM wants to promote multiple downloads that basically get discarded.

EDIT: This may also affect some if not all embedded and @required updaters as the conclusion drawn is that the first value is used for those using @version multiple times... this however is reaching beyond the scope of this ticket.
Martii commented 13 years ago

Comment upstream to arantius http://github.com/greasemonkey/greasemonkey/issues/1233#issuecomment-993634

All that shows is that uso has always done it "wrong"

Thank you for the acknowledgement. I will notify the proper people to get this addressed since it was undocumented and undeclared prior to this Issue.

Martii commented 13 years ago

Comment upstream to sizzlemctwizzle at http://github.com/greasemonkey/greasemonkey/issues/1233#issuecomment-993682

It is my understanding (from a quick review of the source) that only one url value is actually stored when the metadata is parsed, and therefore only one icon will be downloaded.

That is possible in 0.9.2 but when this ticket was made I documented several http requests to same or similar duplicated resources. This may have changed however since November of last year when this Issue was reported./blockquote>

Martii commented 13 years ago

Closing by tag "Invalidated by":

Retested under current GM HEAD and Mozilla/5.0 (X11; Linux x86_64; rv:2.0) Gecko/20100101 Firefox/4.0... Issue is no longer present in GM and clarification has been made on official priority of GM metadata keys always choosing last value. USO however has unrelated issue with picking first value of other supported keys as of this date.