Skip to content
All gists
Back to GitHub
Sign in
Sign up
Sign in
Sign up
{{ message }}
Instantly share code, notes, and snippets.
pingyen
/
fb-sharer-vexed.js
Last active
November 16, 2022 18:48
Star
0
Fork
0
Star
Code
Revisions
4
Embed
What would you like to do?
Embed
Embed this gist in your website.
Share
Copy sharable link for this gist.
Clone via HTTPS
Clone with Git or checkout with SVN using the repository’s web address.
Learn more about clone URLs
Download ZIP
P_Vexed Sharer
Raw
fb-sharer-vexed.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
// ==UserScript==
// @name P_Vexed Sharer
// @namespace https://www.facebook.com/groups/p.vexed
// @version 0.1
// @description Facebook Sharer + P_Vexed
// @author You
// @match https://www.facebook.com/sharer/sharer.php?app_id=123561918055313&u=*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
(async function() {
'use strict';
const waitForSelector = selector => new Promise(resolve => {
const timer = setInterval(() => {
const element = document.querySelector(selector);
if (element === null) {
return;
}
clearInterval(timer);
resolve(element);
}, 100);
});
(await waitForSelector('[audience="self"]')).click();
(await waitForSelector('[audience="group"]')).click();
const input = await waitForSelector('#audience_group');
input.click();
document.execCommand('InsertText', false, 'P_Vexed');
input.dispatchEvent(new FocusEvent('focusin', { bubbles: true }));
(await waitForSelector('[id="587289954686277"]')).dispatchEvent(new MouseEvent('mousedown', { bubbles: true }));
setTimeout(() => {
document.getElementById('platformDialogForm').submit();
}, 200);
})();
Sign up for free
to join this conversation on GitHub
. Already have an account?
Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.