Spaces:
Runtime error
Runtime error
Niv Sardi
commited on
Commit
·
05802f8
0
Parent(s):
init
Browse filesSigned-off-by: Niv Sardi <xaiki@evilgiggle.com>
- .gitattributes +1 -0
- detect.js +23 -0
- icons/48.png +3 -0
- manifest.json +15 -0
.gitattributes
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
detect.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Set up a mutation observer to listen for title changes
|
| 2 |
+
// Will fire if framework AJAX stuff switches page title
|
| 3 |
+
let createObserver = function() {
|
| 4 |
+
let observer = new MutationObserver((mutations) => {
|
| 5 |
+
// Disconnect the MO so there isn't an infinite title update loop
|
| 6 |
+
// Run title cleanup again
|
| 7 |
+
// Create a new MO to listen for more changes
|
| 8 |
+
console.log('Mutations!', mutations)
|
| 9 |
+
observer.disconnect()
|
| 10 |
+
observer = null
|
| 11 |
+
cleanup()
|
| 12 |
+
createObserver()
|
| 13 |
+
})
|
| 14 |
+
|
| 15 |
+
observer.observe(
|
| 16 |
+
document.querySelector('input'),
|
| 17 |
+
{ subtree: true, characterData: true, childList: true }
|
| 18 |
+
)
|
| 19 |
+
}
|
| 20 |
+
createObserver()
|
| 21 |
+
|
| 22 |
+
// Kick off initial page load check
|
| 23 |
+
cleanup()
|
icons/48.png
ADDED
|
|
Git LFS Details
|
manifest.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"manifest_version": 2,
|
| 3 |
+
"name": "Spoof detect",
|
| 4 |
+
"version": "0.1",
|
| 5 |
+
"icons": {
|
| 6 |
+
"48": "icons/48.png"
|
| 7 |
+
},
|
| 8 |
+
"description": "Try to detect website spoofing",
|
| 9 |
+
"content_scripts": [
|
| 10 |
+
{
|
| 11 |
+
"matches": ["<all_urls>"],
|
| 12 |
+
"js": ["detect.js"]
|
| 13 |
+
}
|
| 14 |
+
]
|
| 15 |
+
}
|