rocketshipapps / hardenedpaste

[Retired] Hardened Paste is a browser extension that prevents the “pastejacking” exploit.
http://hardenedpaste.com/
GNU General Public License v3.0
30 stars 3 forks source link

Doesn't work for threatpost.com #7

Closed zamber closed 7 years ago

zamber commented 8 years ago

https://threatpost.com/scope-of-thinkpwn-uefi-zero-day-expands/119027/

Inlined in head around line 114:

<script type='text/javascript'>
function addLink() {
    if (
window.getSelection().containsNode(
document.getElementsByClassName('entry-content')[0], true)) {
    var body_element = document.getElementsByTagName('body')[0];
    var selection;
    selection = window.getSelection();
    var oldselection = selection
    var pagelink = "<br /><br /> See more at: Scope of ThinkPwn UEFI Zero Day Expands <a href='https://wp.me/p3AjUX-uXN'>https://wp.me/p3AjUX-uXN</a>"; //Change this if you like
    var copy_text = selection + pagelink;
    var new_div = document.createElement('div');
    new_div.style.left='-99999px';
    new_div.style.position='absolute';

    body_element.appendChild(new_div );
    new_div.innerHTML = copy_text ;
    selection.selectAllChildren(new_div );
    window.setTimeout(function() {
        body_element.removeChild(new_div );
    },0);
}
}

document.oncopy = addLink;
</script>
oldestlivingboy commented 7 years ago

Thank you for the report – we’ve retired Hardened Paste, but the code remains available here.