Closed eklem closed 5 years ago
Can't be IndexedDB, because we don't have access to it when on other pages. Needs to be generated HTML. Could be from nowsearch.xyz ?
Hmm, no. Can't store a secret key somewhere in the open. Only need the bookmark in the browser to store/hold the secret keys. Add them when generating the bookmarklet for adding to the browser bookmarks? Maybe IndexedDB is an okay idea after all. Need to be on nowsearch.xyz to add the bookmark. There, the keys are picked up from IndexedDB. When you want to add another browser, you need to add the keys (for now).
Won't work for several reasons: Zapier doesn't seem to accept cross-origin script (maybe possible to get working, maybe not) and jsonbin.io only holding one object at a time.
Actually, I could:
Check if creating a bin for each bookmark will work. Create them under a collection so all bins can be retrieved in one go.
Working! To get data out, you have to do two steps: 1: Query the collection for bins with this javascript:
let req = new XMLHttpRequest();
req.onreadystatechange = () => {
if (req.readyState == XMLHttpRequest.DONE) {
console.log(req.responseText);
}
};
req.open("GET", "https://api.jsonbin.io/e/collection/<COLLECTION_ID>/all-bins", true);
req.setRequestHeader("secret-key", "<SECRET_KEY>");
req.send();
2: loop through and query every bin and then index
Make it use Zapier -> JSONbin.io for storing what's bookmarked. Will need a way to add/define and store the following:
Store in indexedDB.