-
Notifications
You must be signed in to change notification settings - Fork 23
Labels
Description
I just noticed the latest and greatest has an issue with decoding the Amazon p.state. I've been using a major kludge for a few months that someone else might be able to improve on.
var pState;
// If p.state
if (p && 'state' in p) {
var isAmazon = p.state.match("amazon"); // p was returning p.network
if(isAmazon){
pState = decodeURIComponent(escape(p.state)),
pState = pState.replace(/"/g, "\"");
}else{
pState = p.state;
}
// Remove any addition information
// E.g. p.state = 'facebook.page';
try {
var a = JSON.parse(pState);
_this.extend(p, a);
}
catch (e) {
console.error('Could not decode state parameter');
}