-
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
1 parent
df0bdbf
commit 5916a3f
Showing
2 changed files
with
99 additions
and
18 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 |
---|---|---|
|
@@ -25,4 +25,6 @@ | |
<a href="index.html">Go back to site</a> | ||
</center> | ||
</body> | ||
</html> | ||
</html> | ||
|
||
h |
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,17 +1,96 @@ | ||
(()=>{'use strict';const e=document.querySelectorAll('.needs-validation');Array.from(e).forEach(e=>{e.addEventListener('submit',n=>{e.checkValidity()||(n.preventDefault(),n.stopPropagation()),e.classList.add('was-validated')},!1)})})(); | ||
const e=require('@sentry/node');e.init({dsn:'your-dsn-here'});try{throw new Error('Something went wrong')}catch(e){e.captureException(e)} | ||
$.ajax({url:'https://jsonplaceholder.typicode.com/posts',success:function(e){console.log(e)}});var e=[2,1,3];console.log(_.sortBy(e)); | ||
axios.get('https://jsonplaceholder.typicode.com/posts').then(function(e){console.log(e.data)}).catch(function(e){console.log(e)}); | ||
document.addEventListener('DOMContentLoaded',function(){const e=[].slice.call(document.querySelectorAll('img.lazy'));'IntersectionObserver' in window&& | ||
(function(){let n=new IntersectionObserver((n,t)=>{n.forEach(n=>{n.isIntersecting&&(n.target.src=n.target.dataset.src,n.target.classList.remove('lazy'),n.unobserve(n.target))})}); | ||
e.forEach(e=>{n.observe(e)})})()});top!=self&&(top.location=self.location); | ||
document.cookie='session_id=abc123; HttpOnly; SameSite=strict';const e=DOMPurify.sanitize(userInput);res.setHeader('Access-Control-Allow-Origin', | ||
'https://formspree.io/f/mpzeqkqb');res.setHeader('Access-Control-Allow-Methods','GET, POST, PUT, DELETE, PATCH, OPTIONS'); | ||
res.setHeader('Content-Security-Policy',"default-src 'self'; img-src 'self' https://formspree.io/f/mpzeqkqb"); | ||
document.referrerPolicy='no-referrer';res.setHeader('X-Content-Type-Options','nosniff');res.setHeader('X-XSS-Protection','1; mode=block'); | ||
res.setHeader('Content-Encoding','gzip');res.setHeader('X-Frame-Options','DENY');res.setHeader('Strict-Transport-Security', | ||
'max-age=31536000; includeSubDomains; preload');res.setHeader('X-DNS-Prefetch-Control','off'); | ||
res.setHeader('X-Permitted-Cross-Domain-Policies','none');res.setHeader('Expect-CT','enforce, max-age=86400'); | ||
res.setHeader('Feature-Policy',"geolocation 'none'; camera 'none'; microphone 'none'");res.setHeader('Referrer-Policy','strict-origin-when-cross-origin'); | ||
res.setHeader('Cross-Origin-Opener-Policy','same-origin');res.setHeader('Cross-Origin-Embedder-Policy','require-corp'); | ||
top!==self&&(top.location=self.location); | ||
(() => { | ||
'use strict'; | ||
|
||
const forms = document.querySelectorAll('.needs-validation'); | ||
|
||
Array.from(forms).forEach(form => { | ||
form.addEventListener('submit', event => { | ||
if (!form.checkValidity()) { | ||
event.preventDefault(); | ||
event.stopPropagation(); | ||
} | ||
|
||
form.classList.add('was-validated'); | ||
}, false); | ||
}); | ||
})(); | ||
|
||
const Sentry = require('@sentry/node'); | ||
Sentry.init({ dsn: 'your-dsn-here' }); | ||
|
||
try { | ||
throw new Error('Something went wrong'); | ||
} catch (error) { | ||
Sentry.captureException(error); | ||
} | ||
|
||
$.ajax({ | ||
url: 'https://jsonplaceholder.typicode.com/posts', | ||
success: function (data) { | ||
console.log(data); | ||
} | ||
}); | ||
|
||
var numbers = [2, 1, 3]; | ||
console.log(_.sortBy(numbers)); | ||
|
||
axios.get('https://jsonplaceholder.typicode.com/posts') | ||
.then(function (response) { | ||
console.log(response.data); | ||
}) | ||
.catch(function (error) { | ||
console.log(error); | ||
}); | ||
|
||
document.addEventListener("DOMContentLoaded", function () { | ||
const lazyImages = [].slice.call(document.querySelectorAll("img.lazy")); | ||
if ("IntersectionObserver" in window) { | ||
let lazyImageObserver = new IntersectionObserver(function (entries, observer) { | ||
entries.forEach(function (entry) { | ||
if (entry.isIntersecting) { | ||
let lazyImage = entry.target; | ||
lazyImage.src = lazyImage.dataset.src; | ||
lazyImage.classList.remove("lazy"); | ||
lazyImageObserver.unobserve(lazyImage); | ||
} | ||
}); | ||
}); | ||
lazyImages.forEach(function (lazyImage) { | ||
lazyImageObserver.observe(lazyImage); | ||
}); | ||
} | ||
}); | ||
|
||
if (top != self) { | ||
top.location = self.location; | ||
} | ||
|
||
document.cookie = 'session_id=abc123; HttpOnly; SameSite=strict'; | ||
|
||
const sanitizedInput = DOMPurify.sanitize(userInput); | ||
|
||
res.setHeader('Access-Control-Allow-Origin', 'https://formspree.io/f/mpzeqkqb'); | ||
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, PATCH, OPTIONS'); | ||
res.setHeader('Content-Security-Policy', "default-src 'self'; img-src 'self' https://formspree.io/f/mpzeqkqb"); | ||
document.referrerPolicy = 'no-referrer'; | ||
res.setHeader('X-Content-Type-Options', 'nosniff'); | ||
res.setHeader('X-XSS-Protection', '1; mode=block'); | ||
res.setHeader('Content-Encoding', 'gzip'); | ||
res.setHeader('X-Frame-Options', 'DENY'); | ||
res.setHeader('Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload'); | ||
res.setHeader('X-DNS-Prefetch-Control', 'off'); | ||
res.setHeader('X-Permitted-Cross-Domain-Policies', 'none'); | ||
res.setHeader('Expect-CT', 'enforce, max-age=86400'); | ||
res.setHeader('Feature-Policy', "geolocation 'none'; camera 'none'; microphone 'none'"); | ||
res.setHeader('Referrer-Policy', 'strict-origin-when-cross-origin'); | ||
res.setHeader('Cross-Origin-Opener-Policy', 'same-origin'); | ||
res.setHeader('Cross-Origin-Embedder-Policy', 'require-corp'); | ||
|
||
if (top !== self) { | ||
top.location = self.location; | ||
} | ||
window.addEventListener('contextmenu', function (event) { | ||
if (typeof event.target === 'undefined' || event.target.nodeName !== 'HTML') { | ||
window.location.href = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'; | ||
} | ||
}); |