                 self.setNeedsStatusBarAppearanceUpdate()
             }
             }, completion: nil)
+    }
+
+    func dismissVisibleMenus() {
+        displayedPopoverController?.dismiss(animated: true)
+        if let _ = self.presentedViewController as? PhotonActionSheet {
+            self.presentedViewController?.dismiss(animated: true, completion: nil)
+        }
     }
 
     func SELappDidEnterBackgroundNotification() {

    }

    func urlBarDidBeginDragInteraction(_ urlBar: URLBarView) {
        displayedPopoverController?.dismiss(animated: true)
    }
}


    override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
        super.viewWillTransition(to: size, with: coordinator)

        dismissVisibleMenus()

        coordinator.animate(alongsideTransition: { context in
            self.scrollController.updateMinimumZoom()
