You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
472 B
12 lines
472 B
chrome.contextMenus.onClicked.addListener(function(info) {
|
|
// retrieve 311175 from https://openclipart.org/image/400px/311175
|
|
const imageId = info.srcUrl.split('/').pop()
|
|
const svgUrl = "https://openclipart.org/download/" + imageId
|
|
chrome.downloads.download({url: svgUrl, saveAs: true }, downloadId => console.log(downloadId))
|
|
});
|
|
|
|
chrome.contextMenus.create({
|
|
id: 'open',
|
|
title: chrome.i18n.getMessage('openContextMenuTitle'),
|
|
contexts: ['link'],
|
|
});
|
|
|