- State “DONE” from “TODO” [2024-10-23 Wed 16:04]
browser.menus.create(
{
id: \"org-capture-selection\",
title: \"Capture Selection\",
contexts: [\"selection\"],
documentUrlPatterns: [\"<all_urls>\"], // \"https://*\" not works...
icons: {
\"16\": \"img/icon16.png\",
\"32\": \"img/icon32.png\"
}
},
() => {
if (browser.runtime.lastError)
console.log(`Error: ${browser.runtime.lastError}`)
}
)
browser.menus.onClicked.addListener((info, tab) => {
if (info.menuItemId === \"org-capture-selection\") {
// console.log(info.selectionText);
runScripts();
}
});
- State “DONE” from “WORKING” [2024-10-22 Tue 09:54]
- State “WORKING” from “TODO” [2024-10-22 Tue 09:26]
- State “DONE” from “WORKING” [2024-10-21 Mon 16:54]
- State “WORKING” from “TODO” [2024-10-21 Mon 13:24]
- State “DONE” from “HOLD” [2024-10-21 Mon 10:09]
- State “HOLD” from “WORKING” [2024-10-21 Mon 10:08]
- State “WORKING” from “TODO” [2024-10-21 Mon 10:05]
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
if (request.action === \"summarizeContent\") {
Not sure…
- State “DONE” from “HOLD” [2024-10-22 Tue 15:06]
- State “HOLD” from “WORKING” [2024-10-22 Tue 13:47]
- State “WORKING” from “TODO” [2024-10-22 Tue 13:27]
- State “DONE” from “TODO” [2024-10-22 Tue 13:45]
- State “DONE” from “WORKING” [2024-10-22 Tue 10:57]
- State “WORKING” from “TODO” [2024-10-22 Tue 10:47]
fetch(apiUrl, {
method: \"POST\",
headers: {
\"Content-Type\": \"application/json\",
Authorization: `Bearer ${apiKey}`,
},
body: JSON.stringify({
model: model,
prompt: prompt,
}),
})
- State “DONE” from “HOLD” [2024-10-24 Thu 22:08]
- State “HOLD” from “WORKING” [2024-10-24 Thu 09:27]
- State “WORKING” from “HOLD” [2024-10-24 Thu 09:20]
- State “HOLD” from “WORKING” [2024-10-23 Wed 21:49]
- State “WORKING” from “TODO” [2024-10-23 Wed 21:46]
\"browser_action\": {
\"browser_style\": true,
\"default_icon\": \"img/icon.png\",
// \"default_popup\": \"popup.html\",
\"default_title\": \"Summary and Capture\"
},like https://github.com/mdn/webextensions-examples/blob/main/beastify/popup/choose_beast.js load the background.js and capture the content
- The JavaScript file popup.js is required to communicate with the background.js file by sending messages directly. Failure to establish this direct communication may result in the disappearance of the popup page within the web application.
- When a popup page is specified in the manifest.json file, the click event on the icon is handled or intercepted by the popup.html file. This functionality allows for the display of a popup window when the icon associated with the extension is clicked, providing a user interface for additional interactions or information.
- State “DONE” from “WORKING” [2024-10-25 Fri 10:12]
- State “WORKING” from “TODO” [2024-10-25 Fri 09:59]
https://community.openai.com/t/api-assistant-streaming-curl/731219
curl -N https://api.openai.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-4",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
],
"stream": true
}'- State “DONE” from “WORKING” [2024-10-25 Fri 10:41]
- State “WORKING” from “TODO” [2024-10-25 Fri 10:13]
var readability_exec = browser.tabs.executeScript({ file: \"lib/Readability.js\" });
Better to remove it, it is not stable.
- State “DONE” from “HOLD” [2024-10-25 Fri 15:03]
- State “HOLD” from “WORKING” [2024-10-25 Fri 13:46]
- State “WORKING” from “TODO” [2024-10-25 Fri 12:57]
// add org or org-roam protocol ///////////////////////////////////////////////
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
if (request.action === \"saveOrg\") {
chrome.storage.sync.get(null, (data) => {
let uri;
if (data.useNewStyleLinks) {
uri = \"org-protocol://\" +
data.protocol +
\"?template=\" +
data.template +
\"&url=\" +
request.url +
\"&title=\" +
request.title +
\"&body=\" +
request.content;
} else {
uri = \"org-protocol://\" +
data.protocol +
\":/\" +
data.template +
\"/\" +
request.url +
\"/\" +
request.title +
\"/\" +
request.content;
}
console.log(uri); // Log the URI for debugging
location.href = uri;
});
}
});
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
if (request.action === \"saveRoam\") {
let uri = \"org-protocol://\" +
data.protocol +
\"?template=\" +
\"r\" +
\"&ref=\" +
request.url +
\"&title=\" +
request.title +
\"&body=\" +
request.content;
console.log(uri); // Log the URI for debugging
location.href = uri;
}
});
- State “DONE” from “CANCELLED” [2025-11-22 Sat 16:03]
- State “CANCELLED” from “WORKING” [2025-11-22 Sat 16:03]
- State “WORKING” from “TODO” [2025-07-29 Tue 13:42]
- State “DONE” from “TODO” [2025-12-08 Mon 11:58]
- State “DONE” from “TODO” [2025-12-09 Tue 09:17]
[2024-10-23 Wed 16:04] In file: manifest.json
\"browser_action\": {
\"browser_style\": true,
\"default_icon\": \"img/icon.png\",
// \"default_popup\": \"popup.html\",
\"default_title\": \"Summary and Capture\"
},