Skip to content

Commit

Permalink
Bug 1184554 - Hide View Later extension when in Firefox.
Browse files Browse the repository at this point in the history
  • Loading branch information
rnewman committed Jul 24, 2015
2 parents e22d8bc + aa7ada0 commit c3a9c14
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Client/Frontend/Browser/BrowserViewController.swift
Expand Up @@ -916,11 +916,21 @@ extension BrowserViewController: BrowserToolbarDelegate {
printInfo.jobName = url.absoluteString
printInfo.outputType = .General
let renderer = BrowserPrintPageRenderer(browser: selected)

let activityItems = [printInfo, renderer, selected.title ?? url.absoluteString!, url]

var activityViewController = UIActivityViewController(activityItems: activityItems, applicationActivities: nil)
// Hide 'Add to Reading List' which currently uses Safari
activityViewController.excludedActivityTypes = [UIActivityTypeAddToReadingList]
activityViewController.completionWithItemsHandler = { _, completed, _, _ in

// Hide 'Add to Reading List' which currently uses Safari.
// Also hide our own View Later… after all, you're in the browser!
let viewLater = NSBundle.mainBundle().bundleIdentifier! + ".ViewLater"
activityViewController.excludedActivityTypes = [
UIActivityTypeAddToReadingList,
viewLater, // Doesn't work: rdar://19430419
]

activityViewController.completionWithItemsHandler = { activityType, completed, _, _ in
log.debug("Selected activity type: \(activityType).")
if completed {
if let selectedTab = self.tabManager.selectedTab {
// We don't know what share action the user has chosen so we simply always
Expand Down

0 comments on commit c3a9c14

Please sign in to comment.