Plugins for capturing URLs

Send the URL to your remote server to build your own benign dataset

As of 03. 07. 2023. See the latest version.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Plugins for capturing URLs
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Send the URL to your remote server to build your own benign dataset
// @author       pic4xiu
// @icon         https://cdn2.iconfinder.com/data/icons/artificial-intelligence-6/64/ArtificialIntelligence6-512.png
// @match        *://*/*
// @grant        GM_xmlhttpRequest
// @license      MIT
// ==/UserScript==

(function() {
  'use strict';

  // Get the URL of the current page
  const currentUrl = window.location.href;

  // Send HTTP request to send URL to server
  GM_xmlhttpRequest({
    method: 'POST',
    url: 'http://***:7000',//Change it to your own. I use Alibaba Cloud. It's easy to use. Go to Alibaba Cloud when you go to the cloud! 
    data: currentUrl,//Of course, if you want to be more secure, you can change it to https
    headers: {
      'Content-Type': 'text/plain'
    },
    onload: function(response) {
      console.log('URL sent to server');
    },
    onerror: function(error) {
      console.error('Error sending URL to server:', error);
    }
  });
})();

/*
//The server receives the URL and writes it to the urls.txt file. This is a demonstration of nodejs
const http = require('http');
const fs = require('fs');

const server = http.createServer((req, res) => {
  if (req.method === 'POST') {
    let body = '';
    req.on('data', chunk => {
      body += chunk.toString();
    });
    req.on('end', () => {
      fs.appendFile('urls.txt', body + '\n', err => {
        if (err) {
          console.error('Error appending URL to file:', err);
          res.statusCode = 500;
          res.end('Error appending URL to file');
        } else {
          console.log('URL appended to file:', body);
          res.statusCode = 200;
          res.end('URL appended to file');
        }
      });
    });
  } else {
    res.statusCode = 404;
    res.end('Not found');
  }
});

server.listen(7000, () => {
  console.log('Server running on port 7000');
*/