Update readme

This commit is contained in:
Corbin Davenport 2022-12-18 23:52:52 -05:00
parent 902bfe950e
commit 9dffd4baf5
2 changed files with 15 additions and 4 deletions

View File

@ -1,2 +1,13 @@
# share-to-mastodon
Browser extension for sharing links to a Mastodon server
# Share to Mastodon
Share to Mastodon is a browser extension for quickly sharing links and tabs to the [Mastodon social network](https://joinmastodon.org/). You can click the Mastodon button in the top bar (or the keyboard shortcut) to share the current tab, or right-click a link on any page. You can also select text and pick Mastodon in the context (right-click) menu to share a snippet.
The extension displays a popup window, where you can edit the pre-filled message, and then publish to your account. It works with any Mastodon server, and it uses the share dialog hosted by the selected server, so no API access is required.
**Download for Chrome (WIP)**
**Download for Microsoft Edge (WIP)**
(Firefox support is [blocked](https://github.com/corbindavenport/share-to-mastodon/issues/1) by limited Manifest V3 support)
![Screenshot of extension in Google Chrome](https://i.imgur.com/vKexj06.png)

View File

@ -47,8 +47,8 @@ function createPopup(serverDomain, shareLink, shareText, tab) {
var popupPage = 'https://' + serverDomain + '/share?text=' + encodeURIComponent(shareText + '\n\n' + shareLink)
var popupWidth = 500
var popupHeight = 500
var y = Math.round(tab.height / 2 - (popupHeight / 2))
var x = Math.round(tab.width / 2 - (popupWidth / 2))
var y = Math.round((tab.height / 2) - (popupHeight / 2))
var x = Math.round((tab.width / 2) - (popupWidth / 2))
console.log(popupWidth, popupHeight, y, x)
chrome.windows.create({
url: popupPage,