numist/this-might-be-offensive — Issue #20: pickuplink is changed by prefetch and being linked to the site
Author: numist
Created: 2011-11-25 04:51:40+00:00
State: open

reported by wintermute: https://thismight.be/offensive/index.php?c=comments&fileid=325131

proposed solution:
add argument to pic.php pickup=1 which, if set, causes the following javascript to be emitted on the page that's loaded:

update the pickup cookie using: http://www.javascripter.net/faq/settinga.htm
update the db cookie using: http://thismight.be/offensive/api.html#set_preference

lastly, remove the pickup argument from the URL using history.replaceState, so copying the link to other users will not virally update their pickuplink as well.

this relies on the assumption that browsers that prefetch only fetch the resources but do not execute scripts until the page is viewed by the user. is this safe?