Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// ==UserScript==
// @name Translation
// @namespace
// @version 0.1
// @description try to take over the world!
// @author You
// @match */*
// @grant none
// ==/UserScript==
(function() {
'use strict';
function textNodesUnder(el){
var n, a=[], walk=document.createTreeWalker(el,NodeFilter.SHOW_TEXT,null,false);
while(n=walk.nextNode()) {
var newNode = document.createElement("p");
newNode.textContent = n.textContent;
n.parentNode.insertBefore(newNode, n);
//return (a);
var body = document.getElementsByTagName('body')[0];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment