mdp / SlidePrint

Print and Capture any DocSend deck or document

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New Error

laurenh2424 opened this issue · comments

Hi! Code isn't running. I'm getting this error

"Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist."

let i=[];chrome.action.onClicked.addListener(async()=>{const[e]=await chrome.tabs.query({active:!0});e&&e.url&&e.id&&(i=[],await chrome.tabs.sendMessage(e.id,{event:"print"}))});chrome.runtime.onMessage.addListener((e,n,t)=>((async()=>{if(!e&&e.event&&t(!1),e.event==="capture"){const a=await chrome.tabs.captureVisibleTab({format:"jpeg",quality:90});console.log(e.dimensions),i.push({img:a,dimensions:e.dimensions||null}),e.done&&await chrome.tabs.create({url:chrome.runtime.getURL("./src/output/index.html")}),t(!0)}else e&&e.event==="output-ready"&&(t(i),i=[])})(),!0));

How can this be fixed

Can you tell me a little more about when you get this error? Does it happen on Docsend, and is it with the latest code (v2.0.2)? If you load/install the extension you'll also need to reload any open Pitch.com or Docsend page for it to load the content script on the page.

Docsend, V2.0.2

I believe I'm getting this error also. Downloaded and set things up just yesterday.
Screenshot 2023-06-22 at 2 43 04 PM
let i=[];chrome.action.onClicked.addListener(async()=>{const[e]=await chrome.tabs.query({active:!0});e&&e.url&&e.id&&(i=[],await chrome.tabs.sendMessage(e.id,{event:"print"}))});chrome.runtime.onMessage.addListener((e,n,t)=>((async()=>{if(!e&&e.event&&t(!1),e.event==="capture"){const a=await chrome.tabs.captureVisibleTab({format:"jpeg",quality:90});console.log(e.dimensions),i.push({img:a,dimensions:e.dimensions||null}),e.done&&await chrome.tabs.create({url:chrome.runtime.getURL("./src/output/index.html")}),t(!0)}else e&&e.event==="output-ready"&&(t(i),i=[])})(),!0));
Here's my chrome stats:
Screenshot 2023-06-22 at 2 44 53 PM
This occurs for me in the installation of the extension and before it loads on the page. When I set it up as an extension - in dev mode - I can see there are errors in it and the above errors are what is produced.
Screenshot 2023-06-22 at 2 47 29 PM