Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
contextMenuBuilder.buildMenuForLink = function (menuInfo) {
var menu = new Menu()
var isEmailAddress = menuInfo.linkURL.startsWith('mailto:')
var isFile = menuInfo.linkURL.startsWith('file:')
var extractedRef = ref.extract(menuInfo.linkURL)
if (!isFile) {
var copyLink = new MenuItem({
label: isEmailAddress ? this.stringTable.copyMail() : this.stringTable.copyLinkUrl(),
click: () => {
// Omit the mailto: portion of the link; we just want the address
clipboard.writeText(isEmailAddress ? menuInfo.linkText : menuInfo.linkURL)
}
})
var openLink = new MenuItem({
label: this.stringTable.openLinkUrl(),
click: () => {
shell.openExternal(menuInfo.linkURL)
}
})
element.querySelectorAll("img").forEach(img => {
var id = ref.extract(img.src);
if (id) {
releases.push(watch(hasBlob(id), has => {
if (has === false) {
img.classList.add("-pending");
} else {
img.classList.remove("-pending");
}
}));
}
});
return function () {