Skip to content

Instantly share code, notes, and snippets.

@ilovejs
Created February 24, 2022 00:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilovejs/38dabd2323f01f087faff72267c10b0b to your computer and use it in GitHub Desktop.
Save ilovejs/38dabd2323f01f087faff72267c10b0b to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name sydneytoday copy helper
// @namespace http://www.github.com/
// @version 0.1.0
// @description copyable
// @author xx
// @license MIT
// @match https://www.sydneytoday.com/*
// @icon https://www.google.com/s2/favicons?domain=www.sydneytoday.com
// @run-at document-start
// @grant none
// ==/UserScript==
(function() {
'use strict';
window.addEventListener('load', (event) => {
console.log('page is fully loaded');
const pathname = location.pathname;
let contentDiv = document.getElementsByClassName("news-content")[0];
contentDiv.removeAttribute("oncopy")
contentDiv.removeAttribute("onselectstart")
console.log(contentDiv);
/*
contentDiv.removeEventListener('selectstart', e => {
return false
});*/
//let new_element = contentDiv.cloneNode(true);
//contentDiv.getEventListeners()
//contentDiv.parentNode.replaceChild(new_element, contentDiv);
});
}
)();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment