-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
181 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
<script src="get_pw.js"></script> | ||
<style> | ||
body, input, button { | ||
font-size: 1.25em; | ||
} | ||
[type="password"] { | ||
width: 100%; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div> | ||
<button id="toggle">Show next example</button> | ||
</div> | ||
<div id="content"></div> | ||
|
||
<p>Click the button to have JavaScript change page content password fields.</p> | ||
|
||
<p>The variable "result" will be logged on each keypress. This variable will contain a JSON object.</p> | ||
|
||
<p>The key value for "passwords" will always contain an array with the values of all password fields present.</p> | ||
|
||
<p>The key value for "ids" will always return an array with the values of all password field "id" attributes present. If any password elements do not have an "id" attribute set, the array will represent their position with an empty string.</p> | ||
</body> | ||
<script> | ||
var examples = [ | ||
` | ||
<input type="password" placeholder="enter password"> | ||
<br><br> | ||
<input id="pw333" type="password" placeholder="enter password. this is the field with a target ID"> | ||
`, | ||
` | ||
<input type="password" id="old-pw" placeholder="old password"> | ||
<input type="password" id="new-pw" placeholder="new password"> | ||
<input type="password" id="confirm-pw" placeholder="confirm new password"> | ||
`, | ||
` | ||
<input type="password" placeholder="enter password"> | ||
` | ||
]; | ||
|
||
var exampleIndex = 0; | ||
|
||
document.querySelector('#toggle').addEventListener('click', function(){ | ||
if (exampleIndex >= examples.length) exampleIndex = 0; | ||
document.querySelector('#content').innerHTML = examples[exampleIndex]; | ||
exampleIndex++; | ||
}); | ||
|
||
window.addEventListener('keyup', function(){ | ||
console.log(result); | ||
}); | ||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
var elementValues = []; | ||
var elements = []; | ||
var result = { | ||
"passwords": [], | ||
"ids": [], | ||
}; | ||
window.addEventListener('keydown', function(){ | ||
elements = document.querySelectorAll('[type="password"]'); | ||
|
||
for (let i = 0; i < elements.length; i++) { | ||
elements[i].addEventListener('keyup', function(){ | ||
result.passwords = Array.from(elements).map(i=>i.value); | ||
result.ids = Array.from(elements).map(i=>i.id); | ||
}); | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,6 +115,8 @@ | |
76D7ADFB284EB15100332EBC /* TCSUnifiedLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 76D7ADF9284EB15000332EBC /* TCSUnifiedLogger.m */; }; | ||
76D7ADFE284EB18600332EBC /* NSFileManager+TCSRealHomeFolder.m in Sources */ = {isa = PBXBuildFile; fileRef = 76D7ADFC284EB18600332EBC /* NSFileManager+TCSRealHomeFolder.m */; }; | ||
76D925D32894ADB4005C3245 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 76EE069F27FD1D01009E0F3A /* Assets.xcassets */; }; | ||
76DB5CF42A09AE9A0014F8E1 /* get_pw.js in Resources */ = {isa = PBXBuildFile; fileRef = 76DB5CF32A09AE9A0014F8E1 /* get_pw.js */; }; | ||
76DB5CF52A09AE9A0014F8E1 /* get_pw.js in Resources */ = {isa = PBXBuildFile; fileRef = 76DB5CF32A09AE9A0014F8E1 /* get_pw.js */; }; | ||
76DC0A6828836EB1007C42B2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76DC0A6728836EB1007C42B2 /* AppDelegate.swift */; }; | ||
76DC0A6A28836EB2007C42B2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 76DC0A6928836EB2007C42B2 /* Assets.xcassets */; }; | ||
76DC0A6D28836EB2007C42B2 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 76DC0A6B28836EB2007C42B2 /* MainMenu.xib */; }; | ||
|
@@ -305,6 +307,7 @@ | |
76D7ADFA284EB15100332EBC /* TCSUnifiedLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TCSUnifiedLogger.h; sourceTree = "<group>"; }; | ||
76D7ADFC284EB18600332EBC /* NSFileManager+TCSRealHomeFolder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSFileManager+TCSRealHomeFolder.m"; sourceTree = "<group>"; }; | ||
76D7ADFD284EB18600332EBC /* NSFileManager+TCSRealHomeFolder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSFileManager+TCSRealHomeFolder.h"; sourceTree = "<group>"; }; | ||
76DB5CF32A09AE9A0014F8E1 /* get_pw.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = get_pw.js; path = Javascript/get_pw/get_pw.js; sourceTree = "<group>"; }; | ||
76DC0A6528836EB1007C42B2 /* XCreds Login Overlay.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "XCreds Login Overlay.app"; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
76DC0A6728836EB1007C42B2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; | ||
76DC0A6928836EB2007C42B2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; | ||
|
@@ -508,6 +511,7 @@ | |
children = ( | ||
76673CD429D3D5F500452848 /* LicenseChecker.swift */, | ||
7683973029A854EC003D9B9F /* NSImage+String.swift */, | ||
76DB5CF32A09AE9A0014F8E1 /* get_pw.js */, | ||
7659CA06298E1BB6005D1AA3 /* DefaultBackground.png */, | ||
7675444428918CD100613840 /* Info.plist */, | ||
76CB9076287FBEEA00C70D0C /* Helper+URLDecode.swift */, | ||
|
@@ -766,6 +770,7 @@ | |
76BEF7E5287202090013E2A1 /* [email protected] in Resources */, | ||
7677908828908E40004E7085 /* WifiWindowController.xib in Resources */, | ||
76BEF7DF2871F6EB0013E2A1 /* LoginWindowControls.xib in Resources */, | ||
76DB5CF52A09AE9A0014F8E1 /* get_pw.js in Resources */, | ||
76BEF7E9287202AF0013E2A1 /* [email protected] in Resources */, | ||
); | ||
runOnlyForDeploymentPostprocessing = 0; | ||
|
@@ -788,6 +793,7 @@ | |
buildActionMask = 2147483647; | ||
files = ( | ||
76DC0A7C28837158007C42B2 /* XCreds Login Overlay.app in Resources */, | ||
76DB5CF42A09AE9A0014F8E1 /* get_pw.js in Resources */, | ||
76CB907E288112C200C70D0C /* xcreds_login.sh in Resources */, | ||
76319377287E1FAF00D36BF7 /* authrights in Resources */, | ||
76319374287E198C00D36BF7 /* XCredsLoginPlugin.bundle in Resources */, | ||
|
@@ -1022,7 +1028,7 @@ | |
"@executable_path/../Frameworks", | ||
"@loader_path/../Frameworks", | ||
); | ||
MARKETING_VERSION = 3.0; | ||
MARKETING_VERSION = 3.1; | ||
PRODUCT_BUNDLE_IDENTIFIER = com.twocanoes.XCredsLoginPlugin; | ||
PRODUCT_NAME = "$(TARGET_NAME)"; | ||
SKIP_INSTALL = YES; | ||
|
@@ -1059,7 +1065,7 @@ | |
"@executable_path/../Frameworks", | ||
"@loader_path/../Frameworks", | ||
); | ||
MARKETING_VERSION = 3.0; | ||
MARKETING_VERSION = 3.1; | ||
PRODUCT_BUNDLE_IDENTIFIER = com.twocanoes.XCredsLoginPlugin; | ||
PRODUCT_NAME = "$(TARGET_NAME)"; | ||
SKIP_INSTALL = YES; | ||
|
@@ -1123,7 +1129,7 @@ | |
"$(inherited)", | ||
"@executable_path/../Frameworks", | ||
); | ||
MARKETING_VERSION = 3.0; | ||
MARKETING_VERSION = 3.1; | ||
PRODUCT_BUNDLE_IDENTIFIER = "com.twocanoes.XCreds-Login-Overlay"; | ||
PRODUCT_NAME = "$(TARGET_NAME)"; | ||
SKIP_INSTALL = YES; | ||
|
@@ -1159,7 +1165,7 @@ | |
"$(inherited)", | ||
"@executable_path/../Frameworks", | ||
); | ||
MARKETING_VERSION = 3.0; | ||
MARKETING_VERSION = 3.1; | ||
PRODUCT_BUNDLE_IDENTIFIER = "com.twocanoes.XCreds-Login-Overlay"; | ||
PRODUCT_NAME = "$(TARGET_NAME)"; | ||
SKIP_INSTALL = YES; | ||
|
@@ -1308,7 +1314,7 @@ | |
"$(inherited)", | ||
"@executable_path/../Frameworks", | ||
); | ||
MARKETING_VERSION = 3.0; | ||
MARKETING_VERSION = 3.1; | ||
PRODUCT_BUNDLE_IDENTIFIER = com.twocanoes.xcreds; | ||
PRODUCT_NAME = "$(TARGET_NAME)"; | ||
STRIP_INSTALLED_PRODUCT = NO; | ||
|
@@ -1343,7 +1349,7 @@ | |
"$(inherited)", | ||
"@executable_path/../Frameworks", | ||
); | ||
MARKETING_VERSION = 3.0; | ||
MARKETING_VERSION = 3.1; | ||
PRODUCT_BUNDLE_IDENTIFIER = com.twocanoes.xcreds; | ||
PRODUCT_NAME = "$(TARGET_NAME)"; | ||
STRIP_INSTALLED_PRODUCT = NO; | ||
|
Oops, something went wrong.