Commit 5949681d authored by 刘燕芳's avatar 刘燕芳

save

parent 9f17e335
......@@ -25,7 +25,8 @@
"*://admin.rtxmdz.com/*",
"http://localhost:8082/*",
"http://localhost:8083/*",
"*://*.rtxmdz.com/*"
"*://*.rtxmdz.com/*",
"http://localhost:10823/*"
],
"js": ["content.js"],
"run_at": "document_idle"
......
{
"name": "linkfahuoyi-exension",
"version": "1.0.0",
"version": "1.1.6",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......
......@@ -59,16 +59,15 @@ chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) {
// let port = chrome.runtime.connect({ name: "bgSendMessage" })
// port.postMessage(message)
}else if (message.action === ACTION.BookingV2) {
// 从bg页面转发给厂家页面的content.js
chrome.tabs.query({
url: bookingV2Urls
}, function (tabs) {
tabs && tabs.forEach(tab => {
// chrome.tabs.sendMessage(tab.id!, message)
chrome.tabs.update(tab.id!, { active: true}, function(tab1) {});
chrome.tabs.sendMessage(tab.id!, { action: ACTION.BookingV2, value: message.value },res=>{
console.log(333,res,new Date().getTime(),new Date().getSeconds());
if(res){
sendResponse(res);
chrome.tabs.update(sender.tab!.id!, { active: true}, function(tab1) {});
......@@ -102,7 +101,8 @@ chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) {
// let port = chrome.runtime.connect({ name: "bgSendMessage" })
// port.postMessage(message)
}
console.log(555);
return true;
})
// chrome.runtime.onConnect.addListener(function (msg) {
......
......@@ -208,6 +208,7 @@ window.addEventListener("message",function(message:any){
if(message.data.action == ACTION.BookingApp){
chrome.runtime.sendMessage(message.data,(ret)=>{
console.log('ret',ret,new Date().getTime(),new Date().getSeconds());
window.postMessage({isResult:1,...ret},"*")
console.log("message ret:",ret,message.data);
})
......@@ -223,6 +224,7 @@ window.addEventListener("message",function(message:any){
//发货易页面
chrome.runtime.onMessage.addListener(function (message: Message, sender, response) {
console.log('发货易页面',message,sender,new Date().getTime(),new Date().getSeconds());
if (message.action === Print) {
if (message.value.waybillNo) {
printWayBillByOld(message.value.waybillNo, message.value.wayCompanyId)
......@@ -241,6 +243,7 @@ chrome.runtime.onMessage.addListener(function (message: Message, sender, respons
result = await BookingV2.booking(message.value.waybillTemplateTitle,message.value.orderNo,message.value.shopId,message.value.fhy_type);
result.action = 'V2'
coming = false
console.log('BookingV2',result,new Date().getTime(),new Date().getSeconds());
response(result);
}
})();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment