forked from haozi/xss-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
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
7 changed files
with
56 additions
and
6 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 @@ | ||
<!doctype html><body><script type=text/javascript src="http://127.0.0.1/app.js"></script></body> |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
function render (input) { | ||
input = input.replace(/script/g, '') | ||
input = input.replace(/script/ig, '') | ||
input = input.toUpperCase() | ||
return '<h1>' + input + '</h1>' | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* global self caches */ | ||
|
||
var cacheStorageKey = 'xss-1' | ||
|
||
var cacheList = [ | ||
'/', | ||
'http://127.0.0.1/app.js' | ||
] | ||
self.addEventListener('install', function (e) { | ||
e.waitUntil( | ||
caches.open(cacheStorageKey).then(function (cache) { | ||
return cache.addAll(cacheList) | ||
}).then(function () { | ||
return self.skipWaiting() | ||
}) | ||
) | ||
}) | ||
|
||
self.addEventListener('activate', function (event) { | ||
event.waitUntil( | ||
caches.keys().then(function (cacheNames) { | ||
return Promise.all( | ||
cacheNames.map(function (cacheName) { | ||
if (cacheName !== CACHE_NAME && cacheName !== IMAGE_CACHE_NAME) { | ||
return caches.delete(cacheName) | ||
} | ||
}) | ||
) | ||
}) | ||
) | ||
}) |