diff --git a/platform/safari/vapi-common.js b/platform/safari/vapi-common.js index dbf0fcdc9..83d4f1ce4 100644 --- a/platform/safari/vapi-common.js +++ b/platform/safari/vapi-common.js @@ -114,22 +114,10 @@ vAPI.i18n = function(s) { /******************************************************************************/ vAPI.closePopup = function() { - var safr = safari.extension.globalPage.contentWindow.safari; - var items = safr.extension.toolbarItems; - - for ( var i = 0; i < items.length; i++ ) { - if ( items[i].browserWindow !== safr.application.activeBrowserWindow ) { - continue; - } - - if ( items[i].popover && items[i].popover.visible ) { - items[i].popover.hide(); - } + var popover = safari.extension.popovers[0]; + if ( popover ) { + popover.hide(); } }; -/******************************************************************************/ - })(); - -/******************************************************************************/