Skip to content

Commit

Permalink
feat: descriptive open full page action
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie authored and aulneau committed Aug 11, 2021
1 parent 25be795 commit 92f2cd2
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 49 deletions.
5 changes: 5 additions & 0 deletions .changeset/green-owls-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@stacks/wallet-web': minor
---

Adds a context menu that opens the wallet in full page mode
2 changes: 1 addition & 1 deletion scripts/generate-manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const manifest = {
author: 'Hiro PBC',
description:
'Hiro Wallet. Use the Stacks blockchain to access privacy-friendly apps, and keep data in your control.',
permissions: ['activeTab'],
permissions: ['activeTab', 'contextMenus'],
manifest_version: 2,
background: {
scripts: ['background.js'],
Expand Down
3 changes: 3 additions & 0 deletions src/background/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ import {
import type { VaultActions } from '@background/vault-types';
import { popupCenter } from '@background/popup';
import { vaultMessageHandler } from '@background/vault';
import { initContextMenuActions } from '@background/init-context-menus';

const IS_TEST_ENV = process.env.TEST_ENV === 'true';

initContextMenuActions();

// Playwright does not currently support Chrome extension popup testing:
// https://github.com/microsoft/playwright/issues/5593
async function openRequestInFullPage(path: string, urlParams: URLSearchParams) {
Expand Down
15 changes: 15 additions & 0 deletions src/background/init-context-menus.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function openNewTabWithWallet() {
return chrome.tabs.create({ url: 'full-page.html' });
}

export function initContextMenuActions() {
chrome.contextMenus.removeAll();

chrome.contextMenus.create({
title: 'Open Hiro Wallet in a new tab',
contexts: ['browser_action'],
async onclick() {
await openNewTabWithWallet();
},
});
}
48 changes: 0 additions & 48 deletions src/manifest.json

This file was deleted.

1 comment on commit 92f2cd2

@vercel
Copy link

@vercel vercel bot commented on 92f2cd2 Aug 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.