Dezaimasu / cute-button

Little button to save images and webms in one click.
https://addons.mozilla.org/en-US/firefox/addon/cute-save-button/
MIT License
42 stars 8 forks source link

Use runtime.lastError instead of extension.lastError #35

Closed bplu4t2f closed 2 years ago

bplu4t2f commented 2 years ago

I'm getting this often (Firefox):

image

Error: Please use $(ref:runtime.lastError).

Problem is, this totally spams the logs of other extensions with error messages as well.

It refers to this code:

/* To override "user" originated css rules form other extensions */
function addButtonStyles(tabId){
  chrome.tabs.insertCSS(tabId, {
    allFrames : true,
    cssOrigin : 'user',
    runAt     : 'document_start',
    file      : 'css/button.css',
  }, () => {
    if (chrome.extension.lastError) {return;}
    chrome.tabs.sendMessage(tabId, 'css_injected');
  });
}

I haven't checked if there are other places that use the legacy extension.lastError alias.