9 Commits

Author SHA1 Message Date
reya
12134c608f bump firefox version 2023-12-05 08:19:22 +07:00
reya
a7d0dc4669 bump version 2023-12-05 08:18:54 +07:00
reya
075153946f fix firefox 2023-12-05 08:17:22 +07:00
reya
dee66f230d fix build for macos 2023-11-28 08:10:12 +07:00
reya
db509a1451 fix build 2023-11-27 15:33:05 +07:00
reya
6a604d0d58 wip: support safari 2023-11-27 15:08:42 +07:00
reya
89675cc986 fix output 2023-11-27 12:36:05 +07:00
reya
a1d3958fb5 improve build and package 2023-11-27 12:26:13 +07:00
reya
0bb9976497 add support for firefox android 2023-11-26 08:33:30 +07:00
70 changed files with 97739 additions and 63 deletions

8
.gitignore vendored
View File

@@ -1,4 +1,10 @@
node_modules
*.build.js
*.zip
/extension/build/style.css
*.xpi
/extension/releases/*.zip
/extension/releases/*.xpi
/extension/output/*.js
/extension/output/*.html
/extension/output/*.css
/extension/output/*.json

View File

@@ -0,0 +1,692 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 56;
objects = {
/* Begin PBXBuildFile section */
31677A162B15715C00E466BD /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31677A152B15715C00E466BD /* AppDelegate.swift */; };
31677A192B15715C00E466BD /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 31677A172B15715C00E466BD /* Main.storyboard */; };
31677A2B2B15715C00E466BD /* Nostr Connect Extension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 31677A2A2B15715C00E466BD /* Nostr Connect Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
31677A322B15715C00E466BD /* Main.html in Resources */ = {isa = PBXBuildFile; fileRef = 316779F42B15715B00E466BD /* Main.html */; };
31677A342B15715C00E466BD /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 316779F62B15715B00E466BD /* Icon.png */; };
31677A362B15715C00E466BD /* Style.css in Resources */ = {isa = PBXBuildFile; fileRef = 316779F72B15715B00E466BD /* Style.css */; };
31677A382B15715C00E466BD /* Script.js in Resources */ = {isa = PBXBuildFile; fileRef = 316779F82B15715B00E466BD /* Script.js */; };
31677A3A2B15715C00E466BD /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 316779F92B15715B00E466BD /* ViewController.swift */; };
31677A3C2B15715C00E466BD /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 316779FA2B15715C00E466BD /* Assets.xcassets */; };
31677A3E2B15715C00E466BD /* SafariWebExtensionHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 316779FC2B15715C00E466BD /* SafariWebExtensionHandler.swift */; };
31677A5D2B15715C00E466BD /* popup.html in Resources */ = {isa = PBXBuildFile; fileRef = 31677A502B15715C00E466BD /* popup.html */; };
31677A5E2B15715C00E466BD /* nostr-provider.js in Resources */ = {isa = PBXBuildFile; fileRef = 31677A512B15715C00E466BD /* nostr-provider.js */; };
31677A5F2B15715C00E466BD /* options.build.js in Resources */ = {isa = PBXBuildFile; fileRef = 31677A522B15715C00E466BD /* options.build.js */; };
31677A602B15715C00E466BD /* background.build.js in Resources */ = {isa = PBXBuildFile; fileRef = 31677A532B15715C00E466BD /* background.build.js */; };
31677A612B15715C00E466BD /* content-script.build.js in Resources */ = {isa = PBXBuildFile; fileRef = 31677A542B15715C00E466BD /* content-script.build.js */; };
31677A622B15715C00E466BD /* icons in Resources */ = {isa = PBXBuildFile; fileRef = 31677A552B15715C00E466BD /* icons */; };
31677A632B15715C00E466BD /* prompt.html in Resources */ = {isa = PBXBuildFile; fileRef = 31677A562B15715C00E466BD /* prompt.html */; };
31677A642B15715C00E466BD /* style.css in Resources */ = {isa = PBXBuildFile; fileRef = 31677A572B15715C00E466BD /* style.css */; };
31677A652B15715C00E466BD /* manifest.json in Resources */ = {isa = PBXBuildFile; fileRef = 31677A582B15715C00E466BD /* manifest.json */; };
31677A662B15715C00E466BD /* prompt.build.js in Resources */ = {isa = PBXBuildFile; fileRef = 31677A592B15715C00E466BD /* prompt.build.js */; };
31677A672B15715C00E466BD /* options.html in Resources */ = {isa = PBXBuildFile; fileRef = 31677A5A2B15715C00E466BD /* options.html */; };
31677A682B15715C00E466BD /* common.js in Resources */ = {isa = PBXBuildFile; fileRef = 31677A5B2B15715C00E466BD /* common.js */; };
31677A692B15715C00E466BD /* popup.build.js in Resources */ = {isa = PBXBuildFile; fileRef = 31677A5C2B15715C00E466BD /* popup.build.js */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
31677A2C2B15715C00E466BD /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 316779EE2B15715B00E466BD /* Project object */;
proxyType = 1;
remoteGlobalIDString = 31677A292B15715C00E466BD;
remoteInfo = "Nostr Connect Extension (macOS)";
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
31677A4B2B15715C00E466BD /* Embed Foundation Extensions */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 13;
files = (
31677A2B2B15715C00E466BD /* Nostr Connect Extension.appex in Embed Foundation Extensions */,
);
name = "Embed Foundation Extensions";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
316779F52B15715B00E466BD /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = Base; path = ../Base.lproj/Main.html; sourceTree = "<group>"; };
316779F62B15715B00E466BD /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
316779F72B15715B00E466BD /* Style.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = Style.css; sourceTree = "<group>"; };
316779F82B15715B00E466BD /* Script.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = Script.js; sourceTree = "<group>"; };
316779F92B15715B00E466BD /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
316779FA2B15715C00E466BD /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
316779FC2B15715C00E466BD /* SafariWebExtensionHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafariWebExtensionHandler.swift; sourceTree = "<group>"; };
31677A042B15715C00E466BD /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
31677A062B15715C00E466BD /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
31677A092B15715C00E466BD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
31677A0C2B15715C00E466BD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
31677A0E2B15715C00E466BD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
31677A132B15715C00E466BD /* Nostr Connect.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Nostr Connect.app"; sourceTree = BUILT_PRODUCTS_DIR; };
31677A152B15715C00E466BD /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
31677A182B15715C00E466BD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
31677A1A2B15715C00E466BD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
31677A1B2B15715C00E466BD /* Nostr Connect.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Nostr Connect.entitlements"; sourceTree = "<group>"; };
31677A252B15715C00E466BD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
31677A2A2B15715C00E466BD /* Nostr Connect Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Nostr Connect Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
31677A2F2B15715C00E466BD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
31677A302B15715C00E466BD /* Nostr Connect.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Nostr Connect.entitlements"; sourceTree = "<group>"; };
31677A502B15715C00E466BD /* popup.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = popup.html; path = ../../extension/output/popup.html; sourceTree = "<group>"; };
31677A512B15715C00E466BD /* nostr-provider.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = "nostr-provider.js"; path = "../../extension/output/nostr-provider.js"; sourceTree = "<group>"; };
31677A522B15715C00E466BD /* options.build.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = options.build.js; path = ../../extension/output/options.build.js; sourceTree = "<group>"; };
31677A532B15715C00E466BD /* background.build.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = background.build.js; path = ../../extension/output/background.build.js; sourceTree = "<group>"; };
31677A542B15715C00E466BD /* content-script.build.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = "content-script.build.js"; path = "../../extension/output/content-script.build.js"; sourceTree = "<group>"; };
31677A552B15715C00E466BD /* icons */ = {isa = PBXFileReference; lastKnownFileType = folder; name = icons; path = ../../extension/output/icons; sourceTree = "<group>"; };
31677A562B15715C00E466BD /* prompt.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = prompt.html; path = ../../extension/output/prompt.html; sourceTree = "<group>"; };
31677A572B15715C00E466BD /* style.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; name = style.css; path = ../../extension/output/style.css; sourceTree = "<group>"; };
31677A582B15715C00E466BD /* manifest.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = manifest.json; path = ../../extension/output/manifest.json; sourceTree = "<group>"; };
31677A592B15715C00E466BD /* prompt.build.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = prompt.build.js; path = ../../extension/output/prompt.build.js; sourceTree = "<group>"; };
31677A5A2B15715C00E466BD /* options.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = options.html; path = ../../extension/output/options.html; sourceTree = "<group>"; };
31677A5B2B15715C00E466BD /* common.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = common.js; path = ../../extension/output/common.js; sourceTree = "<group>"; };
31677A5C2B15715C00E466BD /* popup.build.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = popup.build.js; path = ../../extension/output/popup.build.js; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
31677A102B15715C00E466BD /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
31677A272B15715C00E466BD /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
316779ED2B15715B00E466BD = {
isa = PBXGroup;
children = (
316779F22B15715B00E466BD /* Shared (App) */,
316779FB2B15715C00E466BD /* Shared (Extension) */,
31677A032B15715C00E466BD /* iOS (App) */,
31677A142B15715C00E466BD /* macOS (App) */,
31677A242B15715C00E466BD /* iOS (Extension) */,
31677A2E2B15715C00E466BD /* macOS (Extension) */,
31677A022B15715C00E466BD /* Products */,
);
sourceTree = "<group>";
};
316779F22B15715B00E466BD /* Shared (App) */ = {
isa = PBXGroup;
children = (
316779F92B15715B00E466BD /* ViewController.swift */,
316779FA2B15715C00E466BD /* Assets.xcassets */,
316779F32B15715B00E466BD /* Resources */,
);
path = "Shared (App)";
sourceTree = "<group>";
};
316779F32B15715B00E466BD /* Resources */ = {
isa = PBXGroup;
children = (
316779F42B15715B00E466BD /* Main.html */,
316779F62B15715B00E466BD /* Icon.png */,
316779F72B15715B00E466BD /* Style.css */,
316779F82B15715B00E466BD /* Script.js */,
);
path = Resources;
sourceTree = "<group>";
};
316779FB2B15715C00E466BD /* Shared (Extension) */ = {
isa = PBXGroup;
children = (
31677A4F2B15715C00E466BD /* Resources */,
316779FC2B15715C00E466BD /* SafariWebExtensionHandler.swift */,
);
path = "Shared (Extension)";
sourceTree = "<group>";
};
31677A022B15715C00E466BD /* Products */ = {
isa = PBXGroup;
children = (
31677A132B15715C00E466BD /* Nostr Connect.app */,
31677A2A2B15715C00E466BD /* Nostr Connect Extension.appex */,
);
name = Products;
sourceTree = "<group>";
};
31677A032B15715C00E466BD /* iOS (App) */ = {
isa = PBXGroup;
children = (
31677A042B15715C00E466BD /* AppDelegate.swift */,
31677A062B15715C00E466BD /* SceneDelegate.swift */,
31677A082B15715C00E466BD /* LaunchScreen.storyboard */,
31677A0B2B15715C00E466BD /* Main.storyboard */,
31677A0E2B15715C00E466BD /* Info.plist */,
);
path = "iOS (App)";
sourceTree = "<group>";
};
31677A142B15715C00E466BD /* macOS (App) */ = {
isa = PBXGroup;
children = (
31677A152B15715C00E466BD /* AppDelegate.swift */,
31677A172B15715C00E466BD /* Main.storyboard */,
31677A1A2B15715C00E466BD /* Info.plist */,
31677A1B2B15715C00E466BD /* Nostr Connect.entitlements */,
);
path = "macOS (App)";
sourceTree = "<group>";
};
31677A242B15715C00E466BD /* iOS (Extension) */ = {
isa = PBXGroup;
children = (
31677A252B15715C00E466BD /* Info.plist */,
);
path = "iOS (Extension)";
sourceTree = "<group>";
};
31677A2E2B15715C00E466BD /* macOS (Extension) */ = {
isa = PBXGroup;
children = (
31677A2F2B15715C00E466BD /* Info.plist */,
31677A302B15715C00E466BD /* Nostr Connect.entitlements */,
);
path = "macOS (Extension)";
sourceTree = "<group>";
};
31677A4F2B15715C00E466BD /* Resources */ = {
isa = PBXGroup;
children = (
31677A502B15715C00E466BD /* popup.html */,
31677A512B15715C00E466BD /* nostr-provider.js */,
31677A522B15715C00E466BD /* options.build.js */,
31677A532B15715C00E466BD /* background.build.js */,
31677A542B15715C00E466BD /* content-script.build.js */,
31677A552B15715C00E466BD /* icons */,
31677A562B15715C00E466BD /* prompt.html */,
31677A572B15715C00E466BD /* style.css */,
31677A582B15715C00E466BD /* manifest.json */,
31677A592B15715C00E466BD /* prompt.build.js */,
31677A5A2B15715C00E466BD /* options.html */,
31677A5B2B15715C00E466BD /* common.js */,
31677A5C2B15715C00E466BD /* popup.build.js */,
);
name = Resources;
path = "Shared (Extension)";
sourceTree = SOURCE_ROOT;
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
31677A122B15715C00E466BD /* Nostr Connect (macOS) */ = {
isa = PBXNativeTarget;
buildConfigurationList = 31677A4C2B15715C00E466BD /* Build configuration list for PBXNativeTarget "Nostr Connect (macOS)" */;
buildPhases = (
31677A0F2B15715C00E466BD /* Sources */,
31677A102B15715C00E466BD /* Frameworks */,
31677A112B15715C00E466BD /* Resources */,
31677A4B2B15715C00E466BD /* Embed Foundation Extensions */,
);
buildRules = (
);
dependencies = (
31677A2D2B15715C00E466BD /* PBXTargetDependency */,
);
name = "Nostr Connect (macOS)";
productName = "Nostr Connect (macOS)";
productReference = 31677A132B15715C00E466BD /* Nostr Connect.app */;
productType = "com.apple.product-type.application";
};
31677A292B15715C00E466BD /* Nostr Connect Extension (macOS) */ = {
isa = PBXNativeTarget;
buildConfigurationList = 31677A482B15715C00E466BD /* Build configuration list for PBXNativeTarget "Nostr Connect Extension (macOS)" */;
buildPhases = (
31677A262B15715C00E466BD /* Sources */,
31677A272B15715C00E466BD /* Frameworks */,
31677A282B15715C00E466BD /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = "Nostr Connect Extension (macOS)";
productName = "Nostr Connect Extension (macOS)";
productReference = 31677A2A2B15715C00E466BD /* Nostr Connect Extension.appex */;
productType = "com.apple.product-type.app-extension";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
316779EE2B15715B00E466BD /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1500;
LastUpgradeCheck = 1500;
TargetAttributes = {
31677A122B15715C00E466BD = {
CreatedOnToolsVersion = 15.0;
};
31677A292B15715C00E466BD = {
CreatedOnToolsVersion = 15.0;
};
};
};
buildConfigurationList = 316779F12B15715B00E466BD /* Build configuration list for PBXProject "Nostr Connect" */;
compatibilityVersion = "Xcode 14.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 316779ED2B15715B00E466BD;
productRefGroup = 31677A022B15715C00E466BD /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
31677A122B15715C00E466BD /* Nostr Connect (macOS) */,
31677A292B15715C00E466BD /* Nostr Connect Extension (macOS) */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
31677A112B15715C00E466BD /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
31677A342B15715C00E466BD /* Icon.png in Resources */,
31677A362B15715C00E466BD /* Style.css in Resources */,
31677A192B15715C00E466BD /* Main.storyboard in Resources */,
31677A382B15715C00E466BD /* Script.js in Resources */,
31677A3C2B15715C00E466BD /* Assets.xcassets in Resources */,
31677A322B15715C00E466BD /* Main.html in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
31677A282B15715C00E466BD /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
31677A602B15715C00E466BD /* background.build.js in Resources */,
31677A642B15715C00E466BD /* style.css in Resources */,
31677A632B15715C00E466BD /* prompt.html in Resources */,
31677A5F2B15715C00E466BD /* options.build.js in Resources */,
31677A672B15715C00E466BD /* options.html in Resources */,
31677A662B15715C00E466BD /* prompt.build.js in Resources */,
31677A652B15715C00E466BD /* manifest.json in Resources */,
31677A5E2B15715C00E466BD /* nostr-provider.js in Resources */,
31677A622B15715C00E466BD /* icons in Resources */,
31677A692B15715C00E466BD /* popup.build.js in Resources */,
31677A682B15715C00E466BD /* common.js in Resources */,
31677A612B15715C00E466BD /* content-script.build.js in Resources */,
31677A5D2B15715C00E466BD /* popup.html in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
31677A0F2B15715C00E466BD /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
31677A3A2B15715C00E466BD /* ViewController.swift in Sources */,
31677A162B15715C00E466BD /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
31677A262B15715C00E466BD /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
31677A3E2B15715C00E466BD /* SafariWebExtensionHandler.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
31677A2D2B15715C00E466BD /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 31677A292B15715C00E466BD /* Nostr Connect Extension (macOS) */;
targetProxy = 31677A2C2B15715C00E466BD /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
316779F42B15715B00E466BD /* Main.html */ = {
isa = PBXVariantGroup;
children = (
316779F52B15715B00E466BD /* Base */,
);
name = Main.html;
sourceTree = "<group>";
};
31677A082B15715C00E466BD /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
31677A092B15715C00E466BD /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
31677A0B2B15715C00E466BD /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
31677A0C2B15715C00E466BD /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
31677A172B15715C00E466BD /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
31677A182B15715C00E466BD /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
31677A3F2B15715C00E466BD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
31677A402B15715C00E466BD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SWIFT_COMPILATION_MODE = wholemodule;
};
name = Release;
};
31677A492B15715C00E466BD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "macOS (Extension)/Nostr Connect.entitlements";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = V757GRTBDF;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "macOS (Extension)/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = "Nostr Connect Extension";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 1.0;
OTHER_LDFLAGS = (
"-framework",
SafariServices,
);
PRODUCT_BUNDLE_IDENTIFIER = "com.github.Nostr-Connect.Extension";
PRODUCT_NAME = "Nostr Connect Extension";
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
31677A4A2B15715C00E466BD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "macOS (Extension)/Nostr Connect.entitlements";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = V757GRTBDF;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "macOS (Extension)/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = "Nostr Connect Extension";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@executable_path/../../../../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 1.0;
OTHER_LDFLAGS = (
"-framework",
SafariServices,
);
PRODUCT_BUNDLE_IDENTIFIER = "com.github.Nostr-Connect.Extension";
PRODUCT_NAME = "Nostr Connect Extension";
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
};
name = Release;
};
31677A4D2B15715C00E466BD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "macOS (App)/Nostr Connect.entitlements";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = V757GRTBDF;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "macOS (App)/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = "Nostr Connect";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools";
INFOPLIST_KEY_NSMainStoryboardFile = Main;
INFOPLIST_KEY_NSPrincipalClass = NSApplication;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 1.0;
OTHER_LDFLAGS = (
"-framework",
SafariServices,
"-framework",
WebKit,
);
PRODUCT_BUNDLE_IDENTIFIER = "com.github.Nostr-Connect";
PRODUCT_NAME = "Nostr Connect";
SDKROOT = macosx;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
31677A4E2B15715C00E466BD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "macOS (App)/Nostr Connect.entitlements";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = V757GRTBDF;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "macOS (App)/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = "Nostr Connect";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools";
INFOPLIST_KEY_NSMainStoryboardFile = Main;
INFOPLIST_KEY_NSPrincipalClass = NSApplication;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 1.0;
OTHER_LDFLAGS = (
"-framework",
SafariServices,
"-framework",
WebKit,
);
PRODUCT_BUNDLE_IDENTIFIER = "com.github.Nostr-Connect";
PRODUCT_NAME = "Nostr Connect";
SDKROOT = macosx;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
316779F12B15715B00E466BD /* Build configuration list for PBXProject "Nostr Connect" */ = {
isa = XCConfigurationList;
buildConfigurations = (
31677A3F2B15715C00E466BD /* Debug */,
31677A402B15715C00E466BD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
31677A482B15715C00E466BD /* Build configuration list for PBXNativeTarget "Nostr Connect Extension (macOS)" */ = {
isa = XCConfigurationList;
buildConfigurations = (
31677A492B15715C00E466BD /* Debug */,
31677A4A2B15715C00E466BD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
31677A4C2B15715C00E466BD /* Build configuration list for PBXNativeTarget "Nostr Connect (macOS)" */ = {
isa = XCConfigurationList;
buildConfigurations = (
31677A4D2B15715C00E466BD /* Debug */,
31677A4E2B15715C00E466BD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 316779EE2B15715B00E466BD /* Project object */;
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Nostr Connect (iOS).xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>Nostr Connect (macOS).xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
</dict>
</dict>
</plist>

View File

@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,74 @@
{
"images" : [
{
"size" : "1024x1024",
"idiom" : "universal",
"filename" : "universal-icon-1024@1x.png",
"platform" : "ios"
},
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "mac-icon-16@1x.png",
"scale" : "1x"
},
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "mac-icon-16@2x.png",
"scale" : "2x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "mac-icon-32@1x.png",
"scale" : "1x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "mac-icon-32@2x.png",
"scale" : "2x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "mac-icon-128@1x.png",
"scale" : "1x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "mac-icon-128@2x.png",
"scale" : "2x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "mac-icon-256@1x.png",
"scale" : "1x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "mac-icon-256@2x.png",
"scale" : "2x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "mac-icon-512@1x.png",
"scale" : "1x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "mac-icon-512@2x.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

View File

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "icon128.png"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link rel="stylesheet" href="../Style.css">
<script src="../Script.js" defer></script>
</head>
<body>
<img src="../Icon.png" width="128" height="128" alt="Nostr Connect Icon">
<p class="platform-ios">You can turn on Nostr Connects Safari extension in Settings.</p>
<p class="platform-mac state-unknown">You can turn on Nostr Connects extension in Safari Extensions preferences.</p>
<p class="platform-mac state-on">Nostr Connects extension is currently on. You can turn it off in Safari Extensions preferences.</p>
<p class="platform-mac state-off">Nostr Connects extension is currently off. You can turn it on in Safari Extensions preferences.</p>
<button class="platform-mac open-preferences">Quit and Open Safari Extensions Preferences…</button>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,24 @@
function show(platform, enabled, useSettingsInsteadOfPreferences) {
document.body.classList.add(`platform-${platform}`);
if (useSettingsInsteadOfPreferences) {
document.getElementsByClassName('platform-mac state-on')[0].innerText = "Nostr Connects extension is currently on. You can turn it off in the Extensions section of Safari Settings.";
document.getElementsByClassName('platform-mac state-off')[0].innerText = "Nostr Connects extension is currently off. You can turn it on in the Extensions section of Safari Settings.";
document.getElementsByClassName('platform-mac state-unknown')[0].innerText = "You can turn on Nostr Connects extension in the Extensions section of Safari Settings.";
document.getElementsByClassName('platform-mac open-preferences')[0].innerText = "Quit and Open Safari Settings…";
}
if (typeof enabled === "boolean") {
document.body.classList.toggle(`state-on`, enabled);
document.body.classList.toggle(`state-off`, !enabled);
} else {
document.body.classList.remove(`state-on`);
document.body.classList.remove(`state-off`);
}
}
function openPreferences() {
webkit.messageHandlers.controller.postMessage("open-preferences");
}
document.querySelector("button.open-preferences").addEventListener("click", openPreferences);

View File

@@ -0,0 +1,61 @@
* {
-webkit-user-select: none;
-webkit-user-drag: none;
cursor: default;
}
:root {
color-scheme: light dark;
--spacing: 20px;
}
html {
height: 100%;
}
body {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
gap: var(--spacing);
margin: 0 calc(var(--spacing) * 2);
height: 100%;
font: -apple-system-short-body;
text-align: center;
}
body:not(.platform-mac, .platform-ios) :is(.platform-mac, .platform-ios) {
display: none;
}
body.platform-ios .platform-mac {
display: none;
}
body.platform-mac .platform-ios {
display: none;
}
body.platform-ios .platform-mac {
display: none;
}
body:not(.state-on, .state-off) :is(.state-on, .state-off) {
display: none;
}
body.state-on :is(.state-off, .state-unknown) {
display: none;
}
body.state-off :is(.state-on, .state-unknown) {
display: none;
}
button {
font-size: 1em;
}

View File

@@ -0,0 +1,81 @@
//
// ViewController.swift
// Shared (App)
//
// Created by Phong on 28/11/2023.
//
import WebKit
#if os(iOS)
import UIKit
typealias PlatformViewController = UIViewController
#elseif os(macOS)
import Cocoa
import SafariServices
typealias PlatformViewController = NSViewController
#endif
let extensionBundleIdentifier = "com.github.Nostr-Connect.Extension"
class ViewController: PlatformViewController, WKNavigationDelegate, WKScriptMessageHandler {
@IBOutlet var webView: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
self.webView.navigationDelegate = self
#if os(iOS)
self.webView.scrollView.isScrollEnabled = false
#endif
self.webView.configuration.userContentController.add(self, name: "controller")
self.webView.loadFileURL(Bundle.main.url(forResource: "Main", withExtension: "html")!, allowingReadAccessTo: Bundle.main.resourceURL!)
}
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
#if os(iOS)
webView.evaluateJavaScript("show('ios')")
#elseif os(macOS)
webView.evaluateJavaScript("show('mac')")
SFSafariExtensionManager.getStateOfSafariExtension(withIdentifier: extensionBundleIdentifier) { (state, error) in
guard let state = state, error == nil else {
// Insert code to inform the user that something went wrong.
return
}
DispatchQueue.main.async {
if #available(macOS 13, *) {
webView.evaluateJavaScript("show('mac', \(state.isEnabled), true)")
} else {
webView.evaluateJavaScript("show('mac', \(state.isEnabled), false)")
}
}
}
#endif
}
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
#if os(macOS)
if (message.body as! String != "open-preferences") {
return
}
SFSafariApplication.showPreferencesForExtension(withIdentifier: extensionBundleIdentifier) { error in
guard error == nil else {
// Insert code to inform the user that something went wrong.
return
}
DispatchQueue.main.async {
NSApp.terminate(self)
}
}
#endif
}
}

View File

@@ -0,0 +1,38 @@
//
// SafariWebExtensionHandler.swift
// Shared (Extension)
//
// Created by Phong on 28/11/2023.
//
import SafariServices
import os.log
class SafariWebExtensionHandler: NSObject, NSExtensionRequestHandling {
func beginRequest(with context: NSExtensionContext) {
let request = context.inputItems.first as? NSExtensionItem
let profile: UUID?
if #available(iOS 17.0, macOS 14.0, *) {
profile = request?.userInfo?[SFExtensionProfileKey] as? UUID
} else {
profile = request?.userInfo?["profile"] as? UUID
}
let message: Any?
if #available(iOS 17.0, macOS 14.0, *) {
message = request?.userInfo?[SFExtensionMessageKey]
} else {
message = request?.userInfo?["message"]
}
os_log(.default, "Received message from browser.runtime.sendNativeMessage: %@ (profile: %@)", String(describing: message), profile?.uuidString ?? "none")
let response = NSExtensionItem()
response.userInfo = [ SFExtensionMessageKey: [ "echo": message ] ]
context.completeRequest(returningItems: [ response ], completionHandler: nil)
}
}

View File

@@ -0,0 +1,24 @@
//
// AppDelegate.swift
// iOS (App)
//
// Created by Phong on 28/11/2023.
//
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
}

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19085" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19082"/>
<capability name="Image references" minToolsVersion="12.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6HG-Um-bch">
<rect key="frame" x="142" y="385" width="128" height="128"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<imageReference key="image" image="LargeIcon"/>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="LargeIcon" width="128" height="128"/>
</resources>
</document>

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<wkWebView contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="RDB-ib-igF">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<wkWebViewConfiguration key="configuration">
<audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
<wkPreferences key="preferences"/>
</wkWebViewConfiguration>
</wkWebView>
</subviews>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<connections>
<outlet property="webView" destination="RDB-ib-igF" id="avx-RC-qRB"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SFSafariWebExtensionConverterVersion</key>
<string>15.0</string>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
</dict>
</plist>

View File

@@ -0,0 +1,18 @@
//
// SceneDelegate.swift
// iOS (App)
//
// Created by Phong on 28/11/2023.
//
import UIKit
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let _ = (scene as? UIWindowScene) else { return }
}
}

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.Safari.web-extension</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).SafariWebExtensionHandler</string>
</dict>
</dict>
</plist>

View File

@@ -0,0 +1,21 @@
//
// AppDelegate.swift
// macOS (App)
//
// Created by Phong on 28/11/2023.
//
import Cocoa
@main
class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(_ notification: Notification) {
// Override point for customization after application launch.
}
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return true
}
}

View File

@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="19085" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19085"/>
<plugIn identifier="com.apple.WebKit2IBPlugin" version="19085"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Application-->
<scene sceneID="JPo-4y-FX3">
<objects>
<application id="hnw-xV-0zn" sceneMemberID="viewController">
<menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
<items>
<menuItem title="Nostr Connect" id="1Xt-HY-uBw">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Nostr Connect" systemMenu="apple" id="uQy-DD-JDr">
<items>
<menuItem title="About Nostr Connect" id="5kV-Vb-QxS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
<menuItem title="Hide Nostr Connect" keyEquivalent="h" id="Olw-nP-bQN">
<connections>
<action selector="hide:" target="Ady-hI-5gd" id="PnN-Uc-m68"/>
</connections>
</menuItem>
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="hideOtherApplications:" target="Ady-hI-5gd" id="VT4-aY-XCT"/>
</connections>
</menuItem>
<menuItem title="Show All" id="Kd2-mp-pUS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="unhideAllApplications:" target="Ady-hI-5gd" id="Dhg-Le-xox"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
<menuItem title="Quit Nostr Connect" keyEquivalent="q" id="4sb-4s-VLi">
<connections>
<action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Help" id="wpr-3q-Mcd">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
<items>
<menuItem title="Nostr Connect Help" keyEquivalent="?" id="FKE-Sm-Kum">
<connections>
<action selector="showHelp:" target="Ady-hI-5gd" id="y7X-2Q-9no"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
<connections>
<outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
</connections>
</application>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModuleProvider="target"/>
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="76" y="-134"/>
</scene>
<!--Window Controller-->
<scene sceneID="R2V-B0-nI4">
<objects>
<windowController showSeguePresentationStyle="single" id="B8D-0N-5wS" sceneMemberID="viewController">
<window key="window" title="Nostr Connect" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" releasedWhenClosed="NO" animationBehavior="default" id="IQv-IB-iLA">
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
<windowCollectionBehavior key="collectionBehavior" fullScreenNone="YES"/>
<rect key="contentRect" x="196" y="240" width="425" height="325"/>
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
<connections>
<outlet property="delegate" destination="B8D-0N-5wS" id="98r-iN-zZc"/>
</connections>
</window>
<connections>
<segue destination="XfG-lQ-9wD" kind="relationship" relationship="window.shadowedContentViewController" id="cq2-FE-JQM"/>
</connections>
</windowController>
<customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="250"/>
</scene>
<!--View Controller-->
<scene sceneID="hIz-AP-VOD">
<objects>
<viewController id="XfG-lQ-9wD" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" id="m2S-Jp-Qdl">
<rect key="frame" x="0.0" y="0.0" width="425" height="325"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<wkWebView wantsLayer="YES" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="eOr-cG-IQY">
<rect key="frame" x="0.0" y="0.0" width="425" height="325"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<wkWebViewConfiguration key="configuration">
<audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
<wkPreferences key="preferences"/>
</wkWebViewConfiguration>
</wkWebView>
</subviews>
</view>
<connections>
<outlet property="webView" destination="eOr-cG-IQY" id="GFe-mU-dBY"/>
</connections>
</viewController>
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="75" y="655"/>
</scene>
</scenes>
</document>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SFSafariWebExtensionConverterVersion</key>
<string>15.0</string>
</dict>
</plist>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.Safari.web-extension</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).SafariWebExtensionHandler</string>
</dict>
</dict>
</plist>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
</dict>
</plist>

View File

@@ -1,8 +1,9 @@
#!/usr/bin/env node
const {copy} = require('esbuild-plugin-copy')
const esbuild = require('esbuild')
const prod = process.argv.indexOf('prod') !== -1
const isProd = process.argv.indexOf('prod') !== -1
const isFirefox = process.argv.indexOf('firefox') !== -1
esbuild
.build({
@@ -14,12 +15,42 @@ esbuild
'background.build': './extension/background.js',
'content-script.build': './extension/content-script.js'
},
outdir: './extension/build',
sourcemap: prod ? false : 'inline',
outdir: './extension/output',
sourcemap: isProd ? false : 'inline',
define: {
window: 'self',
global: 'self'
},
watch: !prod
plugins: [
copy({
assets: [
{
from: [
isFirefox
? './extension/firefox/manifest.json'
: './extension/chrome/manifest.json'
],
to: ['./']
},
{
from: ['./extension/*.html'],
to: ['./']
},
{
from: ['./extension/common.js'],
to: ['./']
},
{
from: ['./extension/nostr-provider.js'],
to: ['./']
},
{
from: ['./extension/icons/*'],
to: ['./icons']
}
]
})
.then(() => console.log('build success.'))
]
})
.then(() => console.log('Build success.'))
.catch(err => console.error('Build error.', err))

View File

@@ -126,13 +126,23 @@ async function handleContentScriptMessage({type, params, host}) {
// prompt will be resolved with true or false
let accept = await new Promise((resolve, reject) => {
openPrompt = {resolve, reject}
const url = `${browser.runtime.getURL(
'prompt.html'
)}?${qs.toString()}`
if (browser.windows) {
browser.windows.create({
url: `${browser.runtime.getURL('prompt.html')}?${qs.toString()}`,
url,
type: 'popup',
width: 600,
height: 600
})
} else {
browser.tabs.create({
url,
active: true
})
}
})
// denied, stop here
@@ -205,6 +215,11 @@ async function handlePromptMessage({host, type, accept, conditions}, sender) {
// close prompt
if (sender) {
if (browser.windows) {
browser.windows.remove(sender.tab.windowId)
} else {
// Android Firefox
browser.tabs.remove(sender.tab.id)
}
}
}

View File

@@ -1,7 +1,7 @@
{
"name": "Nostr Connect",
"description": "Nostr Signer Extension",
"version": "0.1.0",
"version": "0.1.2",
"homepage_url": "https://github.com/reyamir/nostr-connect",
"manifest_version": 3,
"icons": {
@@ -12,7 +12,7 @@
},
"options_page": "options.html",
"background": {
"service_worker": "/build/background.build.js"
"service_worker": "background.build.js"
},
"action": {
"default_title": "Nostr Connect",
@@ -21,7 +21,7 @@
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["/build/content-script.build.js"],
"js": ["content-script.build.js"],
"all_frames": true
}
],

View File

@@ -1,5 +1,7 @@
import browser from 'webextension-polyfill'
const EXTENSION = 'nostrconnect'
// inject the script that will provide window.nostr
let script = document.createElement('script')
script.setAttribute('async', 'false')
@@ -12,7 +14,7 @@ window.addEventListener('message', async message => {
if (message.source !== window) return
if (!message.data) return
if (!message.data.params) return
if (message.data.ext !== 'nos2x') return
if (message.data.ext !== EXTENSION) return
// pass on to background
var response
@@ -28,7 +30,7 @@ window.addEventListener('message', async message => {
// return response
window.postMessage(
{id: message.data.id, ext: 'nos2x', response},
{id: message.data.id, ext: EXTENSION, response},
message.origin
)
})

View File

@@ -0,0 +1,35 @@
{
"name": "Nostr Connect",
"description": "Nostr Signer Extension",
"version": "0.1.2",
"homepage_url": "https://github.com/reyamir/nostr-connect",
"manifest_version": 2,
"browser_specific_settings": {
"gecko": {
"id": "{e665d138-0e5b-4b7a-ab91-7af834eda7a2}"
}
},
"icons": {
"16": "icons/icon16.png",
"32": "icons/icon32.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
},
"options_page": "options.html",
"background": {
"scripts": ["background.build.js"]
},
"browser_action": {
"default_title": "Nostr Connect",
"default_popup": "popup.html"
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["content-script.build.js"]
}
],
"permissions": ["storage"],
"optional_permissions": ["notifications"],
"web_accessible_resources": ["nostr-provider.js"]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

View File

@@ -1,3 +1,5 @@
const EXTENSION = 'nostrconnect'
window.nostr = {
_requests: {},
_pubkey: null,
@@ -29,7 +31,7 @@ window.nostr = {
_call(type, params) {
let id = Math.random().toString().slice(-4)
console.log(
'%c[nos2x:%c' +
'%c[nostrconnect:%c' +
id +
'%c]%c calling %c' +
type +
@@ -48,7 +50,7 @@ window.nostr = {
window.postMessage(
{
id,
ext: 'nos2x',
ext: EXTENSION,
type,
params
},
@@ -63,13 +65,15 @@ window.addEventListener('message', message => {
!message.data ||
message.data.response === null ||
message.data.response === undefined ||
message.data.ext !== 'nos2x' ||
message.data.ext !== EXTENSION ||
!window.nostr._requests[message.data.id]
)
return
if (message.data.response.error) {
let error = new Error('nos2x: ' + message.data.response.error.message)
let error = new Error(
`${EXTENSION}: ` + message.data.response.error.message
)
error.stack = message.data.response.error.stack
window.nostr._requests[message.data.id].reject(error)
} else {
@@ -77,7 +81,7 @@ window.addEventListener('message', message => {
}
console.log(
'%c[nos2x:%c' +
'%c[nostrconnect:%c' +
message.data.id +
'%c]%c result: %c' +
JSON.stringify(

View File

@@ -4,10 +4,10 @@
<meta charset="utf-8" />
<title>Nostr Connect</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="/build/style.css" rel="stylesheet" />
<link href="/style.css" rel="stylesheet" />
</head>
<body class="bg-background text-foreground text-sm font-sans antialiased">
<div id="main" />
<script src="/build/options.build.js"></script>
<script src="/options.build.js"></script>
</body>
</html>

0
extension/output/.keep Normal file
View File

File diff suppressed because it is too large Load Diff

116
extension/output/common.js Normal file
View File

@@ -0,0 +1,116 @@
import browser from 'webextension-polyfill'
export const NO_PERMISSIONS_REQUIRED = {
replaceURL: true
}
export const PERMISSION_NAMES = Object.fromEntries([
['getPublicKey', 'read your public key'],
['getRelays', 'read your list of preferred relays'],
['signEvent', 'sign events using your private key'],
['nip04.encrypt', 'encrypt messages to peers'],
['nip04.decrypt', 'decrypt messages from peers']
])
function matchConditions(conditions, event) {
if (conditions?.kinds) {
if (event.kind in conditions.kinds) return true
else return false
}
return true
}
export async function getPermissionStatus(host, type, event) {
let {policies} = await browser.storage.local.get('policies')
let answers = [true, false]
for (let i = 0; i < answers.length; i++) {
let accept = answers[i]
let {conditions} = policies?.[host]?.[accept]?.[type] || {}
if (conditions) {
if (type === 'signEvent') {
if (matchConditions(conditions, event)) {
return accept // may be true or false
} else {
// if this doesn't match we just continue so it will either match for the opposite answer (reject)
// or it will end up returning undefined at the end
continue
}
} else {
return accept // may be true or false
}
}
}
return undefined
}
export async function updatePermission(host, type, accept, conditions) {
let {policies = {}} = await browser.storage.local.get('policies')
// if the new conditions is "match everything", override the previous
if (Object.keys(conditions).length === 0) {
conditions = {}
} else {
// if we already had a policy for this, merge the conditions
let existingConditions = policies[host]?.[accept]?.[type]?.conditions
if (existingConditions) {
if (existingConditions.kinds && conditions.kinds) {
Object.keys(existingConditions.kinds).forEach(kind => {
conditions.kinds[kind] = true
})
}
}
}
// if we have a reverse policy (accept / reject) that is exactly equal to this, remove it
let other = !accept
let reverse = policies?.[host]?.[other]?.[type]
if (
reverse &&
JSON.stringify(reverse.conditions) === JSON.stringify(conditions)
) {
delete policies[host][other][type]
}
// insert our new policy
policies[host] = policies[host] || {}
policies[host][accept] = policies[host][accept] || {}
policies[host][accept][type] = {
conditions, // filter that must match the event (in case of signEvent)
created_at: Math.round(Date.now() / 1000)
}
browser.storage.local.set({policies})
}
export async function removePermissions(host, accept, type) {
let {policies = {}} = await browser.storage.local.get('policies')
delete policies[host]?.[accept]?.[type]
browser.storage.local.set({policies})
}
export async function showNotification(host, answer, type, params) {
let ok = await browser.storage.local.get('notifications')
if (ok) {
let action = answer ? 'allowed' : 'denied'
browser.notifications.create(undefined, {
type: 'basic',
title: `${type} ${action} for ${host}`,
message: JSON.stringify(
params?.event
? {
kind: params.event.kind,
content: params.event.content,
tags: params.event.tags
}
: params,
null,
2
),
iconUrl: 'icons/48x48.png'
})
}
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -0,0 +1,35 @@
{
"name": "Nostr Connect",
"description": "Nostr Signer Extension",
"version": "0.1.2",
"homepage_url": "https://github.com/reyamir/nostr-connect",
"manifest_version": 2,
"browser_specific_settings": {
"gecko": {
"id": "{e665d138-0e5b-4b7a-ab91-7af834eda7a2}"
}
},
"icons": {
"16": "icons/icon16.png",
"32": "icons/icon32.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
},
"options_page": "options.html",
"background": {
"scripts": ["background.build.js"]
},
"browser_action": {
"default_title": "Nostr Connect",
"default_popup": "popup.html"
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["content-script.build.js"]
}
],
"permissions": ["storage"],
"optional_permissions": ["notifications"],
"web_accessible_resources": ["nostr-provider.js"]
}

View File

@@ -0,0 +1,114 @@
const EXTENSION = 'nostrconnect'
window.nostr = {
_requests: {},
_pubkey: null,
async getPublicKey() {
if (this._pubkey) return this._pubkey
this._pubkey = await this._call('getPublicKey', {})
return this._pubkey
},
async signEvent(event) {
return this._call('signEvent', {event})
},
async getRelays() {
return this._call('getRelays', {})
},
nip04: {
async encrypt(peer, plaintext) {
return window.nostr._call('nip04.encrypt', {peer, plaintext})
},
async decrypt(peer, ciphertext) {
return window.nostr._call('nip04.decrypt', {peer, ciphertext})
}
},
_call(type, params) {
let id = Math.random().toString().slice(-4)
console.log(
'%c[nostrconnect:%c' +
id +
'%c]%c calling %c' +
type +
'%c with %c' +
JSON.stringify(params || {}),
'background-color:#f1b912;font-weight:bold;color:white',
'background-color:#f1b912;font-weight:bold;color:#a92727',
'background-color:#f1b912;color:white;font-weight:bold',
'color:auto',
'font-weight:bold;color:#08589d;font-family:monospace',
'color:auto',
'font-weight:bold;color:#90b12d;font-family:monospace'
)
return new Promise((resolve, reject) => {
this._requests[id] = {resolve, reject}
window.postMessage(
{
id,
ext: EXTENSION,
type,
params
},
'*'
)
})
}
}
window.addEventListener('message', message => {
if (
!message.data ||
message.data.response === null ||
message.data.response === undefined ||
message.data.ext !== EXTENSION ||
!window.nostr._requests[message.data.id]
)
return
if (message.data.response.error) {
let error = new Error(
`${EXTENSION}: ` + message.data.response.error.message
)
error.stack = message.data.response.error.stack
window.nostr._requests[message.data.id].reject(error)
} else {
window.nostr._requests[message.data.id].resolve(message.data.response)
}
console.log(
'%c[nostrconnect:%c' +
message.data.id +
'%c]%c result: %c' +
JSON.stringify(
message?.data?.response || message?.data?.response?.error?.message || {}
),
'background-color:#f1b912;font-weight:bold;color:white',
'background-color:#f1b912;font-weight:bold;color:#a92727',
'background-color:#f1b912;color:white;font-weight:bold',
'color:auto',
'font-weight:bold;color:#08589d'
)
delete window.nostr._requests[message.data.id]
})
// hack to replace nostr:nprofile.../etc links with something else
let replacing = null
document.addEventListener('mousedown', replaceNostrSchemeLink)
async function replaceNostrSchemeLink(e) {
if (e.target.tagName !== 'A' || !e.target.href.startsWith('nostr:')) return
if (replacing === false) return
let response = await window.nostr._call('replaceURL', {url: e.target.href})
if (response === false) {
replacing = false
return
}
e.target.href = response
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Nostr Connect</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="/style.css" rel="stylesheet" />
</head>
<body class="bg-background text-foreground text-sm font-sans antialiased">
<div id="main" />
<script src="/options.build.js"></script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Nostr Connect</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="/style.css" rel="stylesheet" />
</head>
<body class="bg-background text-foreground text-sm font-sans antialiased">
<div id="main" />
<script src="/popup.build.js"></script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Nostr Connect</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="/style.css" rel="stylesheet" />
</head>
<body class="bg-background text-foreground text-sm font-sans antialiased">
<div id="main" />
<script src="/prompt.build.js"></script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -4,10 +4,10 @@
<meta charset="utf-8" />
<title>Nostr Connect</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="/build/style.css" rel="stylesheet" />
<link href="/style.css" rel="stylesheet" />
</head>
<body class="bg-background text-foreground text-sm font-sans antialiased">
<div id="main" />
<script src="/build/popup.build.js"></script>
<script src="/popup.build.js"></script>
</body>
</html>

View File

@@ -4,10 +4,10 @@
<meta charset="utf-8" />
<title>Nostr Connect</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="/build/style.css" rel="stylesheet" />
<link href="/style.css" rel="stylesheet" />
</head>
<body class="bg-background text-foreground text-sm font-sans antialiased">
<div id="main" />
<script src="build/prompt.build.js"></script>
<script src="/prompt.build.js"></script>
</body>
</html>

0
extension/releases/.keep Normal file
View File

View File

@@ -22,10 +22,12 @@
},
"scripts": {
"dev": "./build.js; pnpm exec tailwindcss -i ./extension/style.css -o ./extension/build/style.css --watch",
"build": "pnpm exec tailwindcss -i ./extension/style.css -o ./extension/build/style.css; ./build.js prod",
"package": "./build.js prod; cd extension; zip -r archive *; cd ..; mv extension/archive.zip ./nostrconnect.zip"
"build": "pnpm exec tailwindcss -i ./extension/style.css -o ./extension/output/style.css; ./build.js prod",
"package:chrome": "pnpm exec tailwindcss -i ./extension/style.css -o ./extension/output/style.css --minify; ./build.js prod; cd extension/output; zip -r archive *; cd ../../; mv extension/output/archive.zip extension/releases/nostrconnect_chrome.zip",
"package:firefox": "pnpm exec tailwindcss -i ./extension/style.css -o ./extension/output/style.css --minify; ./build.js prod firefox; cd extension/output; zip -r archive *; cd ../../; mv extension/output/archive.zip extension/releases/nostrconnect_firefox.xpi"
},
"devDependencies": {
"esbuild-plugin-copy": "^2.1.1",
"tailwindcss": "^3.3.5"
}
}

97
pnpm-lock.yaml generated
View File

@@ -61,6 +61,9 @@ dependencies:
version: 0.8.0
devDependencies:
esbuild-plugin-copy:
specifier: ^2.1.1
version: 2.1.1(esbuild@0.14.54)
tailwindcss:
specifier: ^3.3.5
version: 3.3.5
@@ -1522,7 +1525,6 @@ packages:
cpu: [loong64]
os: [linux]
requiresBuild: true
dev: false
optional: true
/@eslint-community/eslint-utils@4.4.0(eslint@8.54.0):
@@ -2407,7 +2409,6 @@ packages:
engines: {node: '>=8'}
dependencies:
color-convert: 2.0.1
dev: false
/ansi-styles@5.2.0:
resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==}
@@ -2461,6 +2462,11 @@ packages:
is-string: 1.0.7
dev: false
/array-union@2.1.0:
resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==}
engines: {node: '>=8'}
dev: true
/array.prototype.flat@1.3.2:
resolution: {integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==}
engines: {node: '>= 0.4'}
@@ -2771,7 +2777,6 @@ packages:
dependencies:
ansi-styles: 4.3.0
supports-color: 7.2.0
dev: false
/chokidar@3.5.3:
resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==}
@@ -2851,7 +2856,6 @@ packages:
engines: {node: '>=7.0.0'}
dependencies:
color-name: 1.1.4
dev: false
/color-name@1.1.3:
resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==}
@@ -2859,7 +2863,6 @@ packages:
/color-name@1.1.4:
resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
dev: false
/colorette@1.4.0:
resolution: {integrity: sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==}
@@ -3081,6 +3084,13 @@ packages:
resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==}
dev: true
/dir-glob@3.0.1:
resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==}
engines: {node: '>=8'}
dependencies:
path-type: 4.0.0
dev: true
/dlv@1.1.3:
resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==}
dev: true
@@ -3268,7 +3278,6 @@ packages:
cpu: [x64]
os: [android]
requiresBuild: true
dev: false
optional: true
/esbuild-android-arm64@0.14.54:
@@ -3277,7 +3286,6 @@ packages:
cpu: [arm64]
os: [android]
requiresBuild: true
dev: false
optional: true
/esbuild-darwin-64@0.14.54:
@@ -3286,7 +3294,6 @@ packages:
cpu: [x64]
os: [darwin]
requiresBuild: true
dev: false
optional: true
/esbuild-darwin-arm64@0.14.54:
@@ -3295,7 +3302,6 @@ packages:
cpu: [arm64]
os: [darwin]
requiresBuild: true
dev: false
optional: true
/esbuild-freebsd-64@0.14.54:
@@ -3304,7 +3310,6 @@ packages:
cpu: [x64]
os: [freebsd]
requiresBuild: true
dev: false
optional: true
/esbuild-freebsd-arm64@0.14.54:
@@ -3313,7 +3318,6 @@ packages:
cpu: [arm64]
os: [freebsd]
requiresBuild: true
dev: false
optional: true
/esbuild-linux-32@0.14.54:
@@ -3322,7 +3326,6 @@ packages:
cpu: [ia32]
os: [linux]
requiresBuild: true
dev: false
optional: true
/esbuild-linux-64@0.14.54:
@@ -3331,7 +3334,6 @@ packages:
cpu: [x64]
os: [linux]
requiresBuild: true
dev: false
optional: true
/esbuild-linux-arm64@0.14.54:
@@ -3340,7 +3342,6 @@ packages:
cpu: [arm64]
os: [linux]
requiresBuild: true
dev: false
optional: true
/esbuild-linux-arm@0.14.54:
@@ -3349,7 +3350,6 @@ packages:
cpu: [arm]
os: [linux]
requiresBuild: true
dev: false
optional: true
/esbuild-linux-mips64le@0.14.54:
@@ -3358,7 +3358,6 @@ packages:
cpu: [mips64el]
os: [linux]
requiresBuild: true
dev: false
optional: true
/esbuild-linux-ppc64le@0.14.54:
@@ -3367,7 +3366,6 @@ packages:
cpu: [ppc64]
os: [linux]
requiresBuild: true
dev: false
optional: true
/esbuild-linux-riscv64@0.14.54:
@@ -3376,7 +3374,6 @@ packages:
cpu: [riscv64]
os: [linux]
requiresBuild: true
dev: false
optional: true
/esbuild-linux-s390x@0.14.54:
@@ -3385,7 +3382,6 @@ packages:
cpu: [s390x]
os: [linux]
requiresBuild: true
dev: false
optional: true
/esbuild-netbsd-64@0.14.54:
@@ -3394,7 +3390,6 @@ packages:
cpu: [x64]
os: [netbsd]
requiresBuild: true
dev: false
optional: true
/esbuild-openbsd-64@0.14.54:
@@ -3403,16 +3398,26 @@ packages:
cpu: [x64]
os: [openbsd]
requiresBuild: true
dev: false
optional: true
/esbuild-plugin-copy@2.1.1(esbuild@0.14.54):
resolution: {integrity: sha512-Bk66jpevTcV8KMFzZI1P7MZKZ+uDcrZm2G2egZ2jNIvVnivDpodZI+/KnpL3Jnap0PBdIHU7HwFGB8r+vV5CVw==}
peerDependencies:
esbuild: '>= 0.14.0'
dependencies:
chalk: 4.1.2
chokidar: 3.5.3
esbuild: 0.14.54
fs-extra: 10.1.0
globby: 11.1.0
dev: true
/esbuild-sunos-64@0.14.54:
resolution: {integrity: sha512-28GZ24KmMSeKi5ueWzMcco6EBHStL3B6ubM7M51RmPwXQGLe0teBGJocmWhgwccA1GeFXqxzILIxXpHbl9Q/Kw==}
engines: {node: '>=12'}
cpu: [x64]
os: [sunos]
requiresBuild: true
dev: false
optional: true
/esbuild-windows-32@0.14.54:
@@ -3421,7 +3426,6 @@ packages:
cpu: [ia32]
os: [win32]
requiresBuild: true
dev: false
optional: true
/esbuild-windows-64@0.14.54:
@@ -3430,7 +3434,6 @@ packages:
cpu: [x64]
os: [win32]
requiresBuild: true
dev: false
optional: true
/esbuild-windows-arm64@0.14.54:
@@ -3439,7 +3442,6 @@ packages:
cpu: [arm64]
os: [win32]
requiresBuild: true
dev: false
optional: true
/esbuild@0.14.54:
@@ -3469,7 +3471,6 @@ packages:
esbuild-windows-32: 0.14.54
esbuild-windows-64: 0.14.54
esbuild-windows-arm64: 0.14.54
dev: false
/escalade@3.1.1:
resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==}
@@ -3798,6 +3799,15 @@ packages:
engines: {node: '>= 0.6'}
dev: false
/fs-extra@10.1.0:
resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==}
engines: {node: '>=12'}
dependencies:
graceful-fs: 4.2.11
jsonfile: 6.1.0
universalify: 2.0.1
dev: true
/fs-extra@8.1.0:
resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==}
engines: {node: '>=6 <7 || >=8'}
@@ -3920,6 +3930,18 @@ packages:
define-properties: 1.2.1
dev: false
/globby@11.1.0:
resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==}
engines: {node: '>=10'}
dependencies:
array-union: 2.1.0
dir-glob: 3.0.1
fast-glob: 3.3.2
ignore: 5.3.0
merge2: 1.4.1
slash: 3.0.0
dev: true
/gopd@1.0.1:
resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==}
dependencies:
@@ -3928,7 +3950,6 @@ packages:
/graceful-fs@4.2.11:
resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
dev: false
/graphemer@1.4.0:
resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==}
@@ -3946,7 +3967,6 @@ packages:
/has-flag@4.0.0:
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
engines: {node: '>=8'}
dev: false
/has-property-descriptors@1.0.1:
resolution: {integrity: sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==}
@@ -4017,7 +4037,6 @@ packages:
/ignore@5.3.0:
resolution: {integrity: sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==}
engines: {node: '>= 4'}
dev: false
/image-size@1.0.2:
resolution: {integrity: sha512-xfOoWjceHntRb3qFCrh5ZFORYH8XCdYpASltMhZ/Q0KZiOwjdE/Yl2QCiWdwD+lygV5bMCvauzgu5PxBX/Yerg==}
@@ -4508,6 +4527,14 @@ packages:
graceful-fs: 4.2.11
dev: false
/jsonfile@6.1.0:
resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==}
dependencies:
universalify: 2.0.1
optionalDependencies:
graceful-fs: 4.2.11
dev: true
/jsx-ast-utils@3.3.5:
resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==}
engines: {node: '>=4.0'}
@@ -5358,6 +5385,11 @@ packages:
/path-parse@1.0.7:
resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
/path-type@4.0.0:
resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}
engines: {node: '>=8'}
dev: true
/picocolors@1.0.0:
resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==}
@@ -6015,7 +6047,6 @@ packages:
/slash@3.0.0:
resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==}
engines: {node: '>=8'}
dev: false
/slice-ansi@2.1.0:
resolution: {integrity: sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==}
@@ -6203,7 +6234,6 @@ packages:
engines: {node: '>=8'}
dependencies:
has-flag: 4.0.0
dev: false
/supports-color@8.1.1:
resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==}
@@ -6436,6 +6466,11 @@ packages:
engines: {node: '>= 4.0.0'}
dev: false
/universalify@2.0.1:
resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==}
engines: {node: '>= 10.0.0'}
dev: true
/unpipe@1.0.0:
resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==}
engines: {node: '>= 0.8'}