default-opener icon indicating copy to clipboard operation
default-opener copied to clipboard

Error: Attempting to use a disconnected port object

Open lolmaus opened this issue 8 years ago • 3 comments

Hey @kumar303, thank you for updating the readme.

I followed it very carefully and it still won't work for me.

Here's what I see in the log:

[1028:1028:0922/133011.626205:INFO:CONSOLE(11)] "Sending: link http://d.aliexpress.com/http://trade.alibaba.com/order_detail.htm?order_id=503899967560071&tracelog=rowan&rowan_id1=buyerAcceptGoodsTORemindGoodsAcceptToBuyer_en_US_2017-09-21&rowan_msg_id=007150389996756$47a5c37d7e814915a41305051b5833b6&ck=in_edm_other ", source: chrome-extension://pcnngcfomnggkpeoffiigmnlcpnnpbgp/background.js (11)
[1028:1028:0922/133011.626359:INFO:CONSOLE(0)] "Error in event handler for contextMenus: Error: Attempting to use a disconnected port object
    at onclick (chrome-extension://pcnngcfomnggkpeoffiigmnlcpnnpbgp/background.js:12:10)", source: chrome-extension://pcnngcfomnggkpeoffiigmnlcpnnpbgp/_generated_background_page.html (0)

I tried to keep the app running in the background with python default_opener.py, but it doesn't make a difference.

lolmaus avatar Sep 22 '17 10:09 lolmaus

The port gets connected here so I would check earlier in the log to see if there's a reason for why it got disconnected. As I understand it, Chrome starts up its own process to run default_opener.py in the background but I don't know when that starts. Maybe when Chrome start up? If there is some error in the script (like maybe you have a different version of Python) then I suppose it will crash and that could cause the error you saw but that's just a guess.

On my machine it uses python 2.7.13 to run the script. Can you run this on your machine and tell me what version you see?

/usr/bin/env python --version

kumar303 avatar Sep 22 '17 14:09 kumar303

actually, heh, you probably won't see any logging. I just added it so pull in these git changes and reload the extension (or restart Chrome). https://github.com/kumar303/default-opener/commit/d33d1135f67687da54e7f1ed8eb8a245bbe1c529

kumar303 avatar Sep 22 '17 14:09 kumar303

Adding port = chrome.runtime.connectNative("default_opener"); to the disconnect listener seems to fix it.

piegamesde avatar Nov 01 '18 22:11 piegamesde