Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
3
3xa3-group-project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mullen Thomas
3xa3-group-project
Commits
fdb61907
Commit
fdb61907
authored
7 years ago
by
RationalCoding
Browse files
Options
Downloads
Patches
Plain Diff
generate salt in browser action
parent
dc224b87
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!7
Fixes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/src/browser_action/js/browser_action.js
+10
-1
10 additions, 1 deletion
src/src/browser_action/js/browser_action.js
with
10 additions
and
1 deletion
src/src/browser_action/js/browser_action.js
+
10
−
1
View file @
fdb61907
...
@@ -8,6 +8,14 @@
...
@@ -8,6 +8,14 @@
chrome
.
tabs
.
onUpdated
.
addListener
(
tabChanged
.
bind
(
this
))
chrome
.
tabs
.
onUpdated
.
addListener
(
tabChanged
.
bind
(
this
))
chrome
.
tabs
.
onCreated
.
addListener
(
tabChanged
.
bind
(
this
))
chrome
.
tabs
.
onCreated
.
addListener
(
tabChanged
.
bind
(
this
))
// get or generate salt
var
salt
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'
salt
'
)
||
'
null
'
)
if
(
!
salt
)
{
salt
=
Array
.
from
(
window
.
crypto
.
getRandomValues
(
new
Uint8Array
(
256
)))
// 2048 bits!
window
.
localStorage
.
setItem
(
'
salt
'
,
JSON
.
stringify
(
salt
))
}
console
.
log
(
salt
)
function
tabChanged
(
tab
)
{
function
tabChanged
(
tab
)
{
chrome
.
tabs
.
getSelected
(
null
,
function
(
tab
)
{
chrome
.
tabs
.
getSelected
(
null
,
function
(
tab
)
{
...
@@ -56,13 +64,14 @@
...
@@ -56,13 +64,14 @@
infoView
()
infoView
()
passField
.
addEventListener
(
'
keyup
'
,
generate
.
bind
(
this
))
passField
.
addEventListener
(
'
keyup
'
,
generate
.
bind
(
this
))
domain
.
addEventListener
(
'
keyup
'
,
generate
.
bind
(
this
))
domain
Field
.
addEventListener
(
'
keyup
'
,
generate
.
bind
(
this
))
function
generate
()
{
function
generate
()
{
var
masterPassword
=
document
.
getElementById
(
'
master
'
).
value
var
masterPassword
=
document
.
getElementById
(
'
master
'
).
value
var
output
=
document
.
getElementById
(
'
output
'
)
var
output
=
document
.
getElementById
(
'
output
'
)
var
p
=
new
PretzelPass
()
var
p
=
new
PretzelPass
()
p
.
setSalt
(
salt
)
p
.
setOptions
(
JSON
.
parse
(
localStorage
[
'
options
'
+
domain
]
||
localStorage
[
'
options
'
]
||
'
{}
'
))
p
.
setOptions
(
JSON
.
parse
(
localStorage
[
'
options
'
+
domain
]
||
localStorage
[
'
options
'
]
||
'
{}
'
))
var
generatedPassword
=
p
.
generatePassword
(
masterPassword
,
domain
)
var
generatedPassword
=
p
.
generatePassword
(
masterPassword
,
domain
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment