From 57fc2295b3a44b3b9cd37485b0c2ca2008624b29 Mon Sep 17 00:00:00 2001 From: fkloft Date: Sat, 7 Feb 2015 18:25:40 +0100 Subject: [PATCH] Fix error in botguard detection access to top.opener would throw a SecurityError if opened from intel link. --- code/extract_niantic_parameters.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/extract_niantic_parameters.js b/code/extract_niantic_parameters.js index f03e7804..9ca99b81 100644 --- a/code/extract_niantic_parameters.js +++ b/code/extract_niantic_parameters.js @@ -21,8 +21,12 @@ window.extractFromStock = function() { if(!window[topLevel]) continue; // need an example for a request object for(var property in window[topLevel]) { - if(window[topLevel][property] == "getRegionScoreDetails") { - return Object.getPrototypeOf(window[topLevel]); + try { + if(window[topLevel][property] == "getRegionScoreDetails") { + return Object.getPrototypeOf(window[topLevel]); + } + } catch(e) { // might throw SecurityError or others (noticed on top.opener, which might be cross-origin) + continue; } } }