Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Replace MSN News with Original Sources
- // @namespace http://tampermonkey.net/
- // @version 1.0
- // @description Redirect MSN News articles to their original sources
- // @match *://www.msn.com/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- let paragraphs = document.querySelectorAll("p");
- if (paragraphs.length > 0) {
- let searchQuery = paragraphs[0].innerText.trim();
- let googleSearchURL = `https://www.google.com/search?q="${encodeURIComponent(searchQuery)}"`;
- window.location.href = googleSearchURL;
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment