Is there a name for this browser technique?

Is there a name for this technique, which is to open a page open in a browser, to find specific content and change it?

Some examples:

  • Skype finds the phone numbers on the page and attaches the call menu
  • a script finds the percentages on the page and replaces them with a small pie
  • the advertising engine finds keywords on the page and converts them into hyperlinks
  • add an icon next to all hyperlinks on the page that point to another domain
  • and etc.

I understand that this is a kind of progressive perfection. But I am particularly interested in the first step - the process of detecting content. I would be interested in articles that offer best practices, or explain the flaws of this technique.

Edit: I added an example to show that this method is not only for text nodes, but can be applied to any type of html content.

+5
source share
5 answers

For example, execute this code for this web page (from the console) and all numbers on the page will be replaced with "X":

function walkTheDOM( node, func ) {
    func( node );
    node = node.firstChild;
    while ( node ) {
        walkTheDOM( node, func );
        node = node.nextSibling;
    }
}

walkTheDOM( document.body, function ( node ) {
    if ( node.nodeType === 3 ) {
        node.data = node.data.replace( /\d/g, 'X' );
    }
});

enter image description here

+5
source

This functionality is called add-ons , and the technique they use is to move the DOM

, , - , , , ​​ . .. , Skype

( PNR, Skype Phone Number Recognition), , , - DOM.

, , , , , ajax, .

, javascript-, : Firefox html.

GreaseMonkey jQuery.

0

, , .

, , .

0

, -. , , - Yioop!

-1

, , "- //". :

-

-1

All Articles