OffscreenCanvas, which is pretty much identical to <canvas> element, but without DOM. Instead of this:var canvas = document.createElement('canvas');var context = canvas.getContext('2d');
new canvas =OffscreenCanvas(100, 1);var context = canvas.getContext('2d');
var canvas =new OffscreenCanvas(100, 1);
var context = canvas.getContext('2d');
--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/fe2d550c-cfa4-4079-8e79-be8f088568cd%40chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/A7842079-3750-49B9-BF90-82C055F38008%40pinterest.com.
Host permissions are permissions where you want to inject code, not where you can load resources from. "host_permissions": ["*://*/*"] is a very broad permission and will result in installation-time permission warning like "this extension can read and modify any data on the websites you visit". If you need to download resources from arbitrary URLs, those downloads are restricted by Content Security Policy. The default CSP is script-src 'self'; object-src 'self' which will not allow remote images. Instead, you should specify connect-src and img-src. A good CSP would be script-src 'self'; object-src 'self'; connect-src 'https://example.com/images/*.png' or something similar, where your images are on the example.com domain at paths matching the regex.Then you can fetch the image and put it into the blob// fetch image and convert it to a blobconst imageBlob = await fetch('https://example.com/images/1.png').then(r => r.blob())// convert blob to bitmapconst imageBitmap = await createImageBitmap(imageBlob);// create canvasconst canvas = new OffscreenCanvas(100, 1);// get 2D contextconst context = canvas.getContext('2d');// import the bitmap onto the canvascontext.drawImage(imageBitmap ,0,0);
Also, *://* mathes only URLs with domains, e.g. https://example.com, but not https://example.com/path. In general, ://*/* is better for exaclty that reason. Even better, there is an even more general <all_urls> pattern.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/CABc02_JL_SsP%2BOsTHob0M4ahD%3DQtK6fFQwk%2BW9Xqhkt6cZuHzg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/CABc02_Jgprn82yBNXX2f-zM-Fg705sqByj6yCy-iNZJPbbVyag%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/06114F72-E331-4D8A-BB3A-3E0616092B93%40pinterest.com.