https://github.com/nicosantangelo/weaintfoundshit.js
For those times when finding something in the DOM gets boring
https://github.com/nicosantangelo/weaintfoundshit.js
javascript
Last synced: 11 months ago
JSON representation
For those times when finding something in the DOM gets boring
- Host: GitHub
- URL: https://github.com/nicosantangelo/weaintfoundshit.js
- Owner: nicosantangelo
- License: mit
- Created: 2016-07-11T05:16:17.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-04-23T00:34:27.000Z (about 9 years ago)
- Last Synced: 2025-05-05T15:53:50.987Z (about 1 year ago)
- Topics: javascript
- Language: JavaScript
- Homepage: https://nicosantangelo.github.io/weaintfoundshit.js
- Size: 38.1 KB
- Stars: 24
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# weaintfoundshit.js
A script to quickly tell whether or not your search for a DOM element was sucessful
## Use
To give it a try, add the script to your site and do something like:
```
document.querySelectorAll('itsamemario')
document.querySelector('#its > .john ~ .cena')
// If you use jQuery
jQuery('#not-enough-jquery')
```
If any of those matched something, please email me your site
## Customize
If you don't like the default video (or like to be edgy by making the name of the script rather pointless) you can modify:
```
window.WEAINTFOUND_VIDEO_TYPE // Default: "video/mp4";
window.WEAINTFOUND_VIDEO_URL // Default: "//i.imgur.com/2IuUuar.mp4";
```
If the URL produces an error, you don't have `` support, or you're not connected to the interwebs, a fallback with text will ensue.
## What if I want to use it in every site I visit ?
I got you covered, add this as an URL to a new bookmark:
```
javascript:var s = document.createElement('script');s.src = 'https://cdn.rawgit.com/NicoSantangelo/weaintfoundshit.js/master/weaintfoundshit.min.js';document.getElementsByTagName('body')[0].appendChild(s);s.onload = function () { console.log('Script loaded, everybody rejoice!')};
```
## Demo
[Over here](https://nicosantangelo.github.io/weaintfoundshit.js) ( [mobile/not dev version](https://nicosantangelo.github.io/weaintfoundshit.js/interactive.html) )
**That's all folks**