Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 1 addition & 29 deletions client/serviceworker.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,43 +55,15 @@ app.runtime.onMessage.addListener(async function (
console.log("[get-project-name]");
const tabs = await app.tabs.query({ currentWindow: true, active: true });
const funcNames = request.func_names;
// const projectNames = Object.create(null);
// for (let i = 0; i < funcNames.length; i++) {
// const funcName = funcNames[i];
// if (localStorage[funcName]) {
// projectNames[funcName] = localStorage[funcName];
// }
// }
// const projectNames = new Promise((resolve, reject) => {
// const pNames = Object.create(null);
// app.storage.local.get(funcNames, (res) => {
// for (const funcName of Object.keys(res)) {
// pNames[funcName] = res[funcName];
// }
// resolve(pNames);
// });
// });

const projectNames = await getStorageValues(funcNames);
console.log("...1.", projectNames);
app.tabs.sendMessage(tabs[0].id, {
command: "re:get-project-name",
projectNames,
});
return;
}

// 廃止
// Clipboardに保持されたURLのページタイトルを返却する
// if (cmd === "get-clipboard-page") {
// console.log("[get-clipboard-page]");
// // const bg = window.app.extension.getBackgroundPage();
// // const textarea = document.querySelector("#daiiz-ctrlv");
// // textarea.value = "";
// // textarea.focus();
// // bg.document.execCommand("paste");
// // resopondWebpageTitleOrRawText(textarea.value, sendResponse);
// }

// URLのページタイトルを返却する
if (cmd === "fetch-page-title") {
const text = request.rawText;
Expand Down
19 changes: 0 additions & 19 deletions src/gyazo-com/manage.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,6 @@ exports.detectProject = function () {
return ROOT_PROJECT_NAME;
};

// exports.install2 = () => {
// return new Promise((resolve) => {
// window.app.runtime.sendMessage(
// {
// command: "get-project-name",
// func_names: ["daiiz-gyazo-text-bubble"],
// },
// function (projectNames) {
// console.info("ScrapScripts:", projectNames);
// if (projectNames[DAIIZ_GYAZO_TEXT_BUBBLE]) {
// ROOT_PROJECT_NAME = projectNames[DAIIZ_GYAZO_TEXT_BUBBLE];
// // daiizGyazoTextBubbleMain($appRoot, ROOT_PROJECT_NAME)
// resolve(ROOT_PROJECT_NAME);
// }
// }
// );
// });
// };

exports.install = () => {
return new Promise((resolve, reject) => {
const payload = {
Expand Down
27 changes: 0 additions & 27 deletions src/scrapbox-io/paste-webpage-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,10 @@ const keys = {
v: 86,
};

const execPasteChrome = () => {
const iframe = document.createElement("iframe");
iframe.src = "./"; //chrome.runtime.getURL("sandbox.html");
// document.body.appendChild(iframe);
iframe.onload = () => {
const msg = { command: "hello" };
iframe.contentWindow.postMessage(msg, "*");
};
iframe.onerror = () => {
console.log("error!!!!!!!");
};
iframe.onMessage = (event) => {
console.log("event..........", event);
};
// background scriptに処理を依頼する
// window.app.runtime.sendMessage(
// {
// command: "get-clipboard-page",
// },
// (text) => {
// if (!text) return;
// // insertTextToScrapboxCursor(text);
// }
// );
};

// Clipboardに保持されたURLのページタイトルを返却する
const execPasteFirefox = async () => {
// background scriptに処理を依頼できない
// 拡張機能用のtextareaを生成してbody末尾に挿入
// const a = await navigator.clipboard.readText();
const textInput = document.querySelector("#text-input");

let textarea = document.querySelector("textarea#daiiz-ctrlv");
Expand Down