Remove sharing for images/videos

This commit is contained in:
Corbin Davenport 2022-12-18 16:51:38 -05:00
parent ee924b97b5
commit 915e0fe189
1 changed files with 2 additions and 5 deletions

View File

@ -4,7 +4,7 @@ chrome.runtime.onInstalled.addListener(function (details) {
chrome.contextMenus.create({ chrome.contextMenus.create({
id: "share-to-mastodon", id: "share-to-mastodon",
title: 'Share to Mastodon', title: 'Share to Mastodon',
contexts: ['selection', 'link', 'image', 'video', 'page'] contexts: ['selection', 'link', 'page']
}) })
// Show welcome message // Show welcome message
if (details.reason === 'install' || details.reason === 'update') { if (details.reason === 'install' || details.reason === 'update') {
@ -78,10 +78,7 @@ chrome.contextMenus.onClicked.addListener(async function (info, tab) {
// Set link and description // Set link and description
var shareLink = '' var shareLink = ''
var shareText = '' var shareText = ''
if (info.mediaType) { if (info.linkUrl) {
shareLink = info.srcUrl
shareText = tab.title
} else if (info.linkUrl) {
shareLink = info.linkUrl shareLink = info.linkUrl
shareText = 'Type something here' shareText = 'Type something here'
} else if (info.selectionText) { } else if (info.selectionText) {