some work on the js
This commit is contained in:
parent
b8e617ef6c
commit
aa407f2273
@ -17,6 +17,10 @@ browser.runtime.onMessage.addListener(async (message, sender, sendResponse) => {
|
|||||||
|
|
||||||
const tab = await browser.tabs.get(windowList[0]);
|
const tab = await browser.tabs.get(windowList[0]);
|
||||||
|
|
||||||
|
browser.tabs.sendMessage(tab.id, {
|
||||||
|
type: "GET_DATA_FROM_PAGE",
|
||||||
|
});
|
||||||
|
|
||||||
browser.tabs.sendMessage(sender.tab.id, {
|
browser.tabs.sendMessage(sender.tab.id, {
|
||||||
type: "MY_GET_URL_R",
|
type: "MY_GET_URL_R",
|
||||||
url: tab.url,
|
url: tab.url,
|
||||||
@ -48,6 +52,9 @@ browser.runtime.onInstalled.addListener(async () => {
|
|||||||
browser.menus.onClicked.addListener(async function (e, tab) {
|
browser.menus.onClicked.addListener(async function (e, tab) {
|
||||||
let windowList =
|
let windowList =
|
||||||
(await browser.storage.local.get("windows")).windows ?? [];
|
(await browser.storage.local.get("windows")).windows ?? [];
|
||||||
|
|
||||||
|
console.log("test", e.menuItemId, e.menuItemId === "mark-page-clear");
|
||||||
|
|
||||||
if (e.menuItemId === "mark-page") {
|
if (e.menuItemId === "mark-page") {
|
||||||
console.log("marking page", tab);
|
console.log("marking page", tab);
|
||||||
if (windowList.includes(tab.id)) {
|
if (windowList.includes(tab.id)) {
|
||||||
|
@ -10,6 +10,10 @@ window.addEventListener("message", function (e) {
|
|||||||
} else if (e.data.type === "HAS_EXTENSION_Q") {
|
} else if (e.data.type === "HAS_EXTENSION_Q") {
|
||||||
console.log("Got request for ext");
|
console.log("Got request for ext");
|
||||||
window.postMessage({ type: "HAS_EXTENSION" });
|
window.postMessage({ type: "HAS_EXTENSION" });
|
||||||
|
} else if (e.data.type === "GET_DATA_FROM_PAGE") {
|
||||||
|
console.log(
|
||||||
|
document.querySelector('header[data-test="job-details-header"]'),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
//console.log("here2", e);
|
//console.log("here2", e);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user