From c8216abf1af3a8b9ae0537b4af32db994771c737 Mon Sep 17 00:00:00 2001 From: Ellis Tsung Date: Thu, 2 Feb 2017 19:37:34 -0500 Subject: [PATCH] Code review for #23 fix slightly cleaner and safer approach --- platform/safari/vapi-client.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/safari/vapi-client.js b/platform/safari/vapi-client.js index 6a871579be830..c67f4761aa69a 100644 --- a/platform/safari/vapi-client.js +++ b/platform/safari/vapi-client.js @@ -58,12 +58,12 @@ if ( vAPI.sessionId ) { var safari; if ( typeof self.safari === 'undefined' ) { - safari = self.top.safari; - // https://github.com/el1t/uBlock-Safari/issues/23 - self.safari = safari; -} else { - safari = self.safari; + try { + // https://github.com/el1t/uBlock-Safari/issues/23 + self.safari = self.top.safari; + } catch(e) {} } +safari = self.safari; /******************************************************************************/