Fixed Copy Raw shortcut not working #324
This commit is contained in:
parent
931ad2256d
commit
61f2390323
@ -374,18 +374,15 @@ function copyRaw(test, copyRawElement) {
|
||||
if (!newUrl) newUrl = await imgurHelper.reverse(url);
|
||||
|
||||
if (newUrl) {
|
||||
resolve(true);
|
||||
resolve(newUrl);
|
||||
if (test) return;
|
||||
navigator.clipboard.writeText(newUrl);
|
||||
console.log('newUrl', newUrl)
|
||||
if (copyRawElement) {
|
||||
console.log('working')
|
||||
const textElement = copyRawElement.getElementsByTagName('h4')[0]
|
||||
const oldHtml = textElement.innerHTML;
|
||||
textElement.innerHTML = browser.i18n.getMessage('copied');
|
||||
setTimeout(() => textElement.innerHTML = oldHtml, 1000);
|
||||
}
|
||||
console.log('finished')
|
||||
}
|
||||
}
|
||||
resolve()
|
||||
|
@ -26,6 +26,7 @@
|
||||
"unlimitedStorage",
|
||||
"cookies",
|
||||
"privacy",
|
||||
"clipboardWrite",
|
||||
"contextMenus",
|
||||
"<all_urls>"
|
||||
],
|
||||
|
@ -212,7 +212,7 @@ browser.webRequest.onErrorOccurred.addListener(
|
||||
)
|
||||
|
||||
browser.commands.onCommand.addListener(
|
||||
async command => {
|
||||
command => {
|
||||
if (command === 'switchInstance') utils.switchInstance();
|
||||
else if (command == 'copyRaw') utils.copyRaw();
|
||||
else if (command == 'unify') utils.unify();
|
||||
|
Loading…
x
Reference in New Issue
Block a user