1
0
mirror of https://gitee.com/bitdance-team/chrome-extension synced 2025-01-10 21:58:14 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

Merge remote-tracking branch 'origin/zxs_new' into develop

This commit is contained in:
程序员小墨 2022-02-08 22:39:15 +08:00
commit dd73fb03ed
2 changed files with 8 additions and 14 deletions

View File

@ -8,14 +8,11 @@ $(function() {
// 每次改变开关状态时刷新页面使功能及时生效 // 每次改变开关状态时刷新页面使功能及时生效
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
console.log(`进入 assets\js\mouse-effects\click.js 中的onMessage Listener`) console.log(`进入 assets\js\mouse-effects\click.js 中的onMessage Listener`)
if (request.senderId !== "mouse-effects") {
// 抛给下一个Listener if (request.info === 'click') {
sendResponse(); location.reload();
sendResponse('Reload page');
} }
// TODO: 这里不能这么写,否则会导致其他模块发送消息时触发页面刷新
// console.log('click');
// location.reload();
// sendResponse('Reload page');
console.log(`离开 assets\js\mouse-effects\click.js 中的onMessage Listener`) console.log(`离开 assets\js\mouse-effects\click.js 中的onMessage Listener`)
return true; return true;

View File

@ -7,14 +7,11 @@ $(function() {
// 每次改变开关状态时刷新页面使功能及时生效 // 每次改变开关状态时刷新页面使功能及时生效
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
console.log(`进入 assets\js\mouse-effects\mouse-style.js 中的onMessage Listener`) console.log(`进入 assets\js\mouse-effects\mouse-style.js 中的onMessage Listener`)
if (request.senderId !== "mouse-effects") {
// 抛给下一个Listener if (request.info === 'mouse') {
sendResponse(); location.reload();
sendResponse('Reload page');
} }
// TODO: 这里不能这么写,否则会导致其他模块发送消息时触发页面刷新
// console.log('mouse');
// location.reload();
// sendResponse('Reload page');
console.log(`离开 assets\js\mouse-effects\mouse-style.js 中的onMessage Listener`) console.log(`离开 assets\js\mouse-effects\mouse-style.js 中的onMessage Listener`)
return true; return true;