-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathtest-extension.sh
More file actions
executable file
·181 lines (153 loc) · 5.15 KB
/
Copy pathtest-extension.sh
File metadata and controls
executable file
·181 lines (153 loc) · 5.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
#!/bin/bash
# Script to help test the CyberKeyGen browser extension
# This script will build the extension and provide instructions for loading it in different browsers
echo "🔒 CyberKeyGen Extension Testing Helper 🔒"
echo "=========================================="
echo ""
# Check if we're in the right directory
if [ ! -d "extension" ]; then
echo "❌ Error: Please run this script from the root directory of the CyberShield-Password-Generator repository."
exit 1
fi
# Function to check if a command is available
check_command() {
if ! command -v $1 &> /dev/null; then
echo "❌ $1 not found. Please install it to continue."
return 1
fi
return 0
}
# Build the extension
echo "📦 Building extension..."
npm run build:extension
if [ $? -ne 0 ]; then
echo "❌ Build failed. Please check for errors and try again."
exit 1
fi
echo "✅ Extension built successfully!"
echo "📁 Extension package available at: $(pwd)/dist/CyberKeyGen_extension.zip"
echo ""
# Detect available browsers
echo "🔍 Detecting available browsers..."
browsers=()
if check_command "open"; then
echo "🍎 macOS detected"
# Check for Chrome
if [ -d "/Applications/Google Chrome.app" ]; then
echo "✅ Google Chrome detected"
browsers+=("chrome")
fi
# Check for Edge
if [ -d "/Applications/Microsoft Edge.app" ]; then
echo "✅ Microsoft Edge detected"
browsers+=("edge")
fi
# Check for Firefox
if [ -d "/Applications/Firefox.app" ]; then
echo "✅ Firefox detected"
browsers+=("firefox")
fi
# Check for Safari
if [ -d "/Applications/Safari.app" ]; then
echo "⚠️ Safari detected, but requires additional setup for extension development"
browsers+=("safari")
fi
elif check_command "xdg-open"; then
echo "🐧 Linux detected"
# Check for Chrome
if check_command "google-chrome"; then
echo "✅ Google Chrome detected"
browsers+=("chrome")
fi
# Check for Edge
if check_command "microsoft-edge"; then
echo "✅ Microsoft Edge detected"
browsers+=("edge")
fi
# Check for Firefox
if check_command "firefox"; then
echo "✅ Firefox detected"
browsers+=("firefox")
fi
elif command -v "start" &> /dev/null; then
echo "🪟 Windows detected"
# Note: On Windows, we can't easily check for installed browsers
# So we'll just provide instructions for all browsers
echo "Assuming Chrome, Edge, and Firefox are available"
browsers+=("chrome" "edge" "firefox")
fi
echo ""
echo "📋 Testing Instructions"
echo "======================="
if [[ " ${browsers[*]} " =~ " chrome " ]]; then
echo ""
echo "🌐 Google Chrome:"
echo "1. Open Chrome"
echo "2. Navigate to chrome://extensions/"
echo "3. Enable Developer mode (toggle in top-right corner)"
echo "4. Click 'Load unpacked'"
echo "5. Select the 'extension' folder in this repository"
if [[ "$OSTYPE" == "darwin"* ]]; then
echo ""
echo "To open Chrome extensions page directly:"
echo "open -a 'Google Chrome' 'chrome://extensions/'"
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo ""
echo "To open Chrome extensions page directly:"
echo "google-chrome 'chrome://extensions/'"
fi
fi
if [[ " ${browsers[*]} " =~ " edge " ]]; then
echo ""
echo "🌐 Microsoft Edge:"
echo "1. Open Edge"
echo "2. Navigate to edge://extensions/"
echo "3. Enable Developer mode (toggle in left sidebar)"
echo "4. Click 'Load unpacked'"
echo "5. Select the 'extension' folder in this repository"
if [[ "$OSTYPE" == "darwin"* ]]; then
echo ""
echo "To open Edge extensions page directly:"
echo "open -a 'Microsoft Edge' 'edge://extensions/'"
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo ""
echo "To open Edge extensions page directly:"
echo "microsoft-edge 'edge://extensions/'"
fi
fi
if [[ " ${browsers[*]} " =~ " firefox " ]]; then
echo ""
echo "🌐 Firefox:"
echo "1. Open Firefox"
echo "2. Navigate to about:debugging#/runtime/this-firefox"
echo "3. Click 'Load Temporary Add-on...'"
echo "4. Select the manifest.json file in the 'extension' folder"
if [[ "$OSTYPE" == "darwin"* ]]; then
echo ""
echo "To open Firefox debugging page directly:"
echo "open -a Firefox 'about:debugging#/runtime/this-firefox'"
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo ""
echo "To open Firefox debugging page directly:"
echo "firefox 'about:debugging#/runtime/this-firefox'"
fi
fi
if [[ " ${browsers[*]} " =~ " safari " ]]; then
echo ""
echo "🌐 Safari:"
echo "Safari requires additional setup for extension development:"
echo "1. Enable Developer menu in Safari preferences"
echo "2. Use 'Develop > Show Extension Builder'"
echo "3. Click the '+' button and select 'Add Extension...'"
echo "4. Navigate to the 'extension' folder"
echo "Note: Safari may require additional packaging to work correctly"
fi
echo ""
echo "📝 Testing Checklist:"
echo "- Verify that all password generation methods work"
echo "- Test form filling functionality on sample login pages"
echo "- Verify keyboard shortcuts (Alt+Shift+G, Alt+P)"
echo "- Test context menu integration"
echo "- Check both light and dark themes"
echo ""
echo "🧪 Happy testing! 🧪"