Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chrismendis/1264992 to your computer and use it in GitHub Desktop.
Save chrismendis/1264992 to your computer and use it in GitHub Desktop.
Log the Omniture image request to the console
javascript:var%20j=document.styleSheets,i=document.images,r='';for(var%20x=0;x<j.length;x++)if(j[x].imports)for(var%20y=0;y<j[x].imports.length;y++)if(j[x].imports[y].href.toLowerCase().indexOf('/b/ss/')>=0)r+=j[x].imports[y].href+"\n\n";for(var%20x=0;x<i.length;x++)if(i[x].src.toLowerCase().indexOf('/b/ss/')>=0)r+=i[x].src+"\n\n";for(w_m%20in%20window)if(w_m.substring(0,4)=='s_i_'&&window[w_m].src)if(window[w_m].src.indexOf('/b/ss/')>=0)r+=window[w_m].src;void(console.info('The%20Omniture%20image%20request%20is\n\n'%20+%20r))
var j = document.styleSheets,
i = document.images,
r = '';
// Look through the stylesheets for the Omniture image request
for (var x = 0; x < j.length; x++) if (j[x].imports)
for (var y = 0; y < j[x].imports.length; y++) if (j[x].imports[y].href.toLowerCase().indexOf('/b/ss/') >= 0) r += j[x].imports[y].href + "\n\n";
// Look through the images for the Omniture image request
for (var x = 0; x < i.length; x++) if (i[x].src.toLowerCase().indexOf('/b/ss/') >= 0) r += i[x].src + "\n\n";
// Look through all properties of window for the Omniture image request
for (w_m in window) if (w_m.substring(0, 4) == 's_i_' && window[w_m].src) if (window[w_m].src.indexOf('/b/ss/') >= 0) r += window[w_m].src;
// Log the Omniture image request's src attribute to the console
void(console.info('The Omniture image request is\n\n' + r))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment