Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/taq/pagechecker
Check if a HTML page content changed after it was loaded
https://github.com/taq/pagechecker
Last synced: about 1 month ago
JSON representation
Check if a HTML page content changed after it was loaded
- Host: GitHub
- URL: https://github.com/taq/pagechecker
- Owner: taq
- License: gpl-2.0
- Created: 2014-04-30T12:01:39.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-06-12T12:00:31.000Z (over 10 years ago)
- Last Synced: 2023-04-11T08:51:16.145Z (over 1 year ago)
- Language: JavaScript
- Size: 195 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PageChecker
Check if a HTML page content changed after it was loaded, applying some filters
to remove some contents that can change after it was loaded. Right now only
remove the `` tags.## Why use it
We just got some frauds here with a virus on the computer user that changed the
content of the HTML page after it was loaded, changing some payment data without
the user knowing about it. As the virus takes some seconds to go to a server to
get the new page content, after the page is loaded a checksum is stored and
after some time (configured by user) the page contents is checked again to see
if it's the same.## It works?
Yeah, we tested it with a compromissed computer. :-)
## What is needed to use it?
- JQuery - [http://jquery.com/](http://jquery.com/)
- JQuery MD5 - [https://github.com/placemarker/jQuery-MD5](https://github.com/placemarker/jQuery-MD5)## Usage
Insert the `pagechecker.js` file on the `HEAD` tag and loaded it like this:
```
$(document).ready(function() {
new Bluefish.PageChecker(1500).change(function() {
alert("Page content changed!");
}).check(function() {
console.log("Checking page on "+Date());
});
});
```
Where:1. 1500 is 1500 miliseconds
2. `change` calls an optional function (the default is an `alert` with "Page changed!")
3. `check` calls an optional function to show when the page is being checkedIt can also check a specified selector and not the complete HTML page, this way:
```
pchecker = function() {
return $("p").filter(function(idx, obj) { return $(obj).text().match(/paragraph/); });
};
new Bluefish.PageChecker(1500, pchecker).change(function() {
alert("Paragraph content changed!");
}).check(function() {
// console.log("Checking page on "+Date());
});
```