Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Feb 12, 2024
2 parents 787c03a + fb70408 commit 415b584
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions scripts/generate-manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ const manifest = {
},
content_scripts: [
{
run_at: 'document_start',
js: ['content-script.js'],
matches: ['*://*/*'],
all_frames: true,
Expand Down
17 changes: 13 additions & 4 deletions src/inpage/inpage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,19 @@ const provider: HiroWalletProviderOverrides = {
},
};

window.StacksProvider = provider;
(window as any).LeatherProvider = provider;

(window as any).HiroWalletProvider = provider;
try {
// Make properties immutable to contend with other wallets that use agressive
// "prioritisation" default settings. As wallet use this approach, Leather has
// to use it too, resulting in browsers' own internal logic being used to
// determine content script exeuction order. A more fair way to contend over
// shared provider space.
Object.defineProperty(window, 'StacksProvider', { get: () => provider, set: () => {} });
Object.defineProperty(window, 'LeatherProvider', { get: () => provider, set: () => {} });
Object.defineProperty(window, 'HiroWalletProvider', {
get: () => provider,
set: () => {},
});
} catch (e) {}

if (typeof window.btc === 'undefined') {
(window as any).btc = {
Expand Down

0 comments on commit 415b584

Please sign in to comment.