Skip to content

Instantly share code, notes, and snippets.

@scottgarner
Last active December 17, 2023 19:15
Show Gist options
  • Save scottgarner/3ce88a43c72ab2aeb655e2c1e7b484f7 to your computer and use it in GitHub Desktop.
Save scottgarner/3ce88a43c72ab2aeb655e2c1e7b484f7 to your computer and use it in GitHub Desktop.
SudokuPad Userscript
// ==UserScript==
// @name SudokuPad Copy
// @namespace SudokuPad
// @match https://crackingthecryptic.com/*
// @match https://*.crackingthecryptic.com/*
// @match https://sudokupad.app/*
// @match https://*.sudokupad.app/*
// @grant none
// @version 1.0
// @author Scott Garner
// @run-at document-end
// @description 3/12/2023, 4:21:46 PM
// ==/UserScript==
console.log("SudokuPad Copy Enabled!");
window.document.onkeydown = (event) => {
if (event.key == "c" && event.ctrlKey) {
const sequence = Framework.app.puzzle.selectedCells.map((cell) => {
return cell.given||cell.value || " ";
}).join("");
navigator.clipboard.writeText(sequence);
console.log("Copying sequence:", sequence);
}
}
const main = ()=> {
const gameDiv = document.querySelector(".game");
console.log(gameDiv);
gameDiv.style.background = "limegreen";
const gridDiv = document.querySelector(".grid");
gridDiv.style.background = "white";
}
main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment