Skip to content

Instantly share code, notes, and snippets.

@Luen
Last active April 3, 2024 22:36
Show Gist options
  • Save Luen/e656791d2b30bbaaefa05e983e21b725 to your computer and use it in GitHub Desktop.
Save Luen/e656791d2b30bbaaefa05e983e21b725 to your computer and use it in GitHub Desktop.
mark messages as done - need to right click the done button and that's it. // Script 2, hover over the mark as done button on left (should light up green)
(function() {
const selector = 'div[id] > span > div > div > div > i[data-visualcompletion="css-img"]';
const clickElement = () => {
const element = document.querySelector(selector);
if (element) {
element.click();
} else {
console.error('Element not found:', selector);
}
};
setInterval(clickElement, 1000);
})();
// or
(function() {
const selector = 'div[role="presentation"] div[role="grid"] div[id^="js_"] a[role="row"]';
const clickElement = () => {
const element = document.querySelector(selector);
if (element) {
element.click();
console.log('Button clicked');
} else {
console.error('Element not found:', selector);
}
};
setInterval(clickElement, 1000);
})();
// Click everyone checkbox to invite people:
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
(async () => {
// Find all input elements of type 'checkbox'
const inputs = document.querySelectorAll('input[type="checkbox"]');
// Loop through each input
for (let input of inputs) {
input.click(); // Click the input
await delay(1); // Wait for 1ms before continuing
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment