Newly generated alias from shortcuts is now copied to clipboard

This commit is contained in:
Othmane AJDOR
2020-09-07 22:15:33 +02:00
parent 36ab60d931
commit 5fba72ec0c
2 changed files with 4 additions and 5 deletions
+1 -1
View File
@@ -70,4 +70,4 @@ async function handleOnClickContextMenu(info, tab) {
generateAliasHandlerJS(tab, res);
}
export { handleOnClickContextMenu };
export { handleOnClickContextMenu, generateAliasHandlerJS };
+3 -4
View File
@@ -2,11 +2,10 @@ import browser from "webextension-polyfill";
import APIService from "../popup/APIService";
import SLStorage from "../popup/SLStorage";
import Onboarding from "./onboarding";
import Utils from "../popup/Utils"
import "./content-script";
import { handleNewRandomAlias } from "./create-alias";
import { handleOnClickContextMenu } from "./context-menu";
import { handleOnClickContextMenu, generateAliasHandlerJS } from "./context-menu";
import { firePermissionListener } from "./permissions";
global.isBackgroundJS = true;
@@ -52,9 +51,9 @@ browser.contextMenus.create({
*/
browser.commands.onCommand.addListener(async (command) => {
if (command === "generate-random-alias") {
console.log("generate-random-alias");
const currentTab = (await browser.tabs.query({active: true, currentWindow: true}))[0];
return await handleNewRandomAlias(currentTab.url);
const res = await handleNewRandomAlias(currentTab.url);
generateAliasHandlerJS(currentTab, res);
}
});