Created
September 6, 2019 14:44
-
-
Save Eibwen/596150303fc8bc8131e5dc3f458975e8 to your computer and use it in GitHub Desktop.
Super simple tampermonkey scirpt that collects data then displays it
This file contains hidden or 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
// ==UserScript== | |
// @name Insert info panel - template | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description A template to make pulling information then displaying it in a simple div easier | |
// @author You | |
// @match https://www.google.com/ | |
// @grant none | |
// ==/UserScript== | |
// A CSS selector, will use the first match | |
const targetSelector = "#tophf"; | |
const dataCollectorFunctions = | |
[ | |
() => { return document.querySelector('.gb_lb').innerText; } | |
]; | |
(function() { | |
'use strict'; | |
var match = document.querySelector(targetSelector); | |
var data = dataCollectorFunctions.map(e => e()); | |
var el = document.createElement('div'); | |
el.innerHTML = '<p>Hello World! Aka ' + data + '</p>'; | |
match.appendChild(el); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment