Remote image as notification icon in Chrome Packaged App? - google-chrome-extension

I'm writing this app and would like to display Chrome notifications with certain remote images as notification icons.
I am aware that you are not allowed to directly assign the URL of a remote image as the notification icon, so I assume I would first have to download the remote image via some sort function and then use the now local image as a notification icon.
How could this be achieved?
Thanks in advance

Like sowbug mentioned in his comment, this can be done through Data URL.
Documentation and example can be found in Google's documentation at: http://developer.chrome.com/apps/app_external

Related

How do I dynamically set Chrome Extension Icon based on an image from a different URL

Currently I am migrating my MV2 chrome extension into MV3.
With my MV2 extension, I can dynamically set my extension's icon using an image from a remote url using a code similar to the answer of this stackoverflow topic : Chrome Extension: Icon from URL
With the introduction of manifest-v3 and service workers, the service worker lost access to the DOM, making calls to creating instances of Image and canvas impossible.
My MV3-extension is now using nodeJS. I was looking into a combination of JSDOM, node-canvas, and OffScreenCanvas to implement the original code but no success as of yet.
What would be the best approach to set the icon dynamically (chrome.actions.setIcon), based on an image remotely hosted?
Thank you very much.
This was answered by wOxxOm in the comments for anybody looking into this same issue.
createImageBitmap + OffScreenCanvas can be successfully used in a service worker, no need for JSDOM or any external libraries.

Webpage Icon on Desktop and Notification Badge

We have a web portal and our client have a requirement of keeping the webpage icon on the desktop that part was as easy as keeping and shortcut with icon which points to Webpage, however they also want to have dynamic notification badge on the icon something similar to below one -
This notification badge will keep changing based on number of action items, I couldn't figure out how to solve this without having an full fledge desktop application any pointer or help would be greatly appreciated.

Lightbox Enable in Chrome App/Extension

I have created my first Chrome extension/app and found out that lightboxes do not function inside the app. I created the app from the Google example kiosk app. I'm only using webview in the app and have no other customizations. It just points to a link.
I want to use the app as an auto-launch Kiosk app on a Chromebox. Via this website I found that 'alert' and 'confirm' are a disabled web feature on chrome web apps.
I am wondering if it is possible to enable alert and confirm in the Chrome app so that lightboxes will work when interacting with a website.
Thanks in advance.
Yes you can definitely call alert box inside a chrome extension, just like you would in a normal javasript file as stated in this thread.
chrome.browserAction.onClicked.addListener(
alert("Im an alert box triggered by Chrome Extension")
);
The link you provided suggests that you can create a custom popup/lightbox as a workaround. There's a complete tutorial here.
Happy coding! :)

Launch a particular app to download content from webview in Windows8.1

I want to lauch in C#
UnviewableContentIdentified
event to download an attachment in email e.g. gmail.
So i wrote another app using BackgroundDownloader to download attachment.
But how to launch it when i click on attachment, every time it opens IE metro style.
All i got on internet was Windows.System.Launcher.LaunchUriAsync(uri)
what is URI for a Windows8 app?
Even MSDN community didn't answer it when i asked question there?
Instead of launching uri I just wrote a BackgroundDownlaoder in Unviewablw content event.
So no need to launch a second application.

Download images for google chrome extension

i'm trying to build a batch image downloader in chrome. Basically, i will overlay a small download square to each image on the page and user clicks on it to download. Or the user can click to download all images on a page. I'm currently stuck on figuring out how to download the images. The best i can come up with is to use XHR to send the image to another server, the user can then retrieve it there.
If anyone have a solution for me. It would be much appreciated!
Jason
I believe you can XHR the images and using the File API you can store them locally.
Take a look at the following site http://www.html5rocks.com/features/file there are additional resources on the right column that has detailed examples and tutorials. Such as http://www.html5rocks.com/tutorials/file/filesystem/
Mohamed Mansour
This code will do the trick for you: https://gist.github.com/1049553
It's very simple usage of a 'feature' in chrome when you open an image in a new tab.

Resources