Skip to content

Commit 5013f9a

Browse files
committed
provide extensionId when a library loads an ext
1 parent 677c67b commit 5013f9a

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

src/containers/extension-library.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ const TRUSTED_LOADEXT_ORIGINS = [
5050
'https://sharkpools-extensions.vercel.app',
5151
'https://raw.githubusercontent.com/SharkPool-SP/SharkPools-Extensions/main', // Some people cant connect to vercel
5252
'https://pen-group.github.io',
53+
'http://localhost:5173', // for development
54+
'http://localhost:3000', // for development
5355
];
5456

5557
class ExtensionLibrary extends React.PureComponent {
@@ -118,7 +120,8 @@ class ExtensionLibrary extends React.PureComponent {
118120
// i mean, technically we succeeded
119121
e.source.postMessage({
120122
p4: {
121-
type: 'success'
123+
type: 'success',
124+
extensionId
122125
}
123126
}, e.origin);
124127
} else {
@@ -128,7 +131,8 @@ class ExtensionLibrary extends React.PureComponent {
128131
// succeeded
129132
e.source.postMessage({
130133
p4: {
131-
type: 'success'
134+
type: 'success',
135+
extensionId
132136
}
133137
}, e.origin);
134138
})

src/lib/libraries/extensions/index.jsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,6 +1465,22 @@ if (IsLocal || IsLiveTests) {
14651465
description: 'Opens the editor with this tab as the parent, still with the library opened. For developers.',
14661466
featured: true
14671467
},
1468+
{
1469+
name: 'localhost:5173',
1470+
href: 'http://localhost:5173',
1471+
extensionId: 'special_extensionLibraryLocalhost5173',
1472+
iconURL: defaultExtensionIcon,
1473+
description: 'Opens localhost:5173 in a new tab with this tab as the parent. For developers',
1474+
featured: true
1475+
},
1476+
{
1477+
name: 'localhost:5173?editor=true',
1478+
href: 'http://localhost:5173?editor=true',
1479+
extensionId: 'special_extensionLibraryLocalhost5173EditorTrue',
1480+
iconURL: defaultExtensionIcon,
1481+
description: 'Opens localhost:5173 in a new tab with this tab as the parent. Sets ?editor=true. For developers',
1482+
featured: true
1483+
},
14681484
{
14691485
name: (
14701486
<FormattedMessage

0 commit comments

Comments
 (0)