1234567891011121314151617181920212223242526272829303132 |
- import {
- appendPopupPage,
- tiggerInjectPopupPage
- } from "@/logic/content/twitter.js";
- window.onload = () => {
- appendPopupPage();
- chrome.runtime.sendMessage({
- actionType: "CONTENT_WINDOW_LOADED_SET_POPUP_PAGE",
- data: { }
- }, () => { });
- };
- chrome.runtime.sendMessage({
- actionType: "CONTENT_SET_POPUP_CONFIG",
- data: {
- popup: 'popup.html'
- }
- }, () => { });
- chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
- sendResponse('')
- switch (req.actionType) {
- case 'BACK_PING':
- console.log('BACK_PING')
- chrome.runtime.sendMessage({ actionType: "CONTENT_PONG", data: '1' }, (res) => { console.log(res) })
- break
- case 'BG_INJECT_EXTENSION_POPUP':
- tiggerInjectPopupPage();
- break
- }
- })
|