 		return item
 	}
 }
+
+private final class SharingCommandInfo {
+
+	let service: NSSharingService
+	let items: [Any]
+
+	init(service: NSSharingService, items: [Any]) {
+		self.service = service
+		self.items = items
+	}
+
+	func perform() {
+		service.perform(withItems: items)
+	}
+}

		if articles.anyArticleIsRead() {
			menu.addItem(markUnreadMenuItem(articles))
		}
		if menu.items.count > 0 {
			menu.addItem(NSMenuItem.separator())
		}

		if articles.anyArticleIsUnstarred() {
			menu.addItem(markStarredMenuItem(articles))
		}
		if articles.anyArticleIsStarred() {
			menu.addItem(markUnstarredMenuItem(articles))
		}
		if menu.items.count > 0 && !menu.items.last!.isSeparatorItem {
			menu.addItem(NSMenuItem.separator())
		}

		if articles.count == 1, let link = articles.first!.preferredLink {
			menu.addItem(openInBrowserMenuItem(link))
		}

		return menu

		}
		Browser.open(urlString, inBackground: false)
	}

	@objc func performShareServiceFromContextualMenu(_ sender: Any?) {
		guard let menuItem = sender as? NSMenuItem, let sharingCommandInfo = menuItem.representedObject as? SharingCommandInfo else {
			return
		}
		sharingCommandInfo.perform()
	}
}


