Created
May 1, 2026 00:31
-
-
Save brianschmitt/42eb80270642bdb94d31ec0145789ade to your computer and use it in GitHub Desktop.
Export Todoist as json
This file contains hidden or 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
| var dbName = 'todoist.sync'; | |
| var storeName = 'tasks'; | |
| var request = indexedDB.open(dbName); | |
| request.onsuccess = function(event) { | |
| var db = event.target.result; | |
| var transaction = db.transaction([storeName], "readonly"); | |
| var objectStore = transaction.objectStore(storeName); | |
| var allItemsRequest = objectStore.getAll(); | |
| allItemsRequest.onsuccess = function() { | |
| var all_items = allItemsRequest.result; | |
| console.log(all_items); // Optional: view the items in the console | |
| copy(JSON.stringify(all_items)); // Copies the data as a JSON string to your clipboard | |
| console.log("All items copied to clipboard!"); | |
| }; | |
| allItemsRequest.onerror = function(event) { | |
| console.error("Error retrieving all items:", event.target.errorCode); | |
| }; | |
| }; | |
| request.onerror = function(event) { | |
| console.error("Error opening database:", event.target.errorCode); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment