Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Content Script - SteamGifts Giveaways
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description Content script for retrieving table column headings from SteamGifts Giveaways page
- // @author Your Name
- // @match https://www.steamgifts.com/giveaways/entered
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- console.log('Content script loaded.');
- // Create the result display
- const resultDisplay = document.createElement('div');
- resultDisplay.style.position = 'fixed';
- resultDisplay.style.left = '10px';
- resultDisplay.style.bottom = '50px';
- resultDisplay.style.zIndex = '9999';
- resultDisplay.style.backgroundColor = 'white';
- resultDisplay.style.padding = '10px';
- resultDisplay.style.border = '1px solid #ccc';
- resultDisplay.style.overflow = 'auto';
- resultDisplay.style.maxHeight = '300px';
- document.body.appendChild(resultDisplay);
- // Listen for messages from the background script
- window.addEventListener('message', event => {
- if (event.source !== window) return;
- if (event.data.type && event.data.type === 'SG_COLUMN_HEADINGS_RESULT') {
- console.log('Received column headings result from background script.');
- // Update the result display with the retrieved column headings
- resultDisplay.textContent = event.data.headings;
- }
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement