// Window. addeventlistener ("LOAD", function () {// chrome. extension. sendmessage ({// type: "dom-loaded", // data: {// myproperty: "This is so cool !!! ---- One-time requests, communication happens only once "//}); //}, true ); // ===================================== this is for the hover ================ =============== (function (window) {var document = Invalid invalid Doc ument, body = document. body, A = document. getelementsbytagname ('A'), // For get a href, returns a live htmlcollection of elements with the given Tag Name currentlength =. length, currentlinks = [], displaytimeout, Normalurl, zindex = 100, container, // containerlabel, button, size = 1.0, rate, on, showmodel, hovernow, // to judge whether the mouse point is on hovering delaytime; loadsettings (); addevents (); drawwindow (); // obtain the value from storage and initialize the function loadsettings () {chrome. storage. sync. get (['hoverlinkposition', 'hoverlinkoffsetx', 'hoverlinkoffsety', 'hoverlinknormal', 'hoverlinkdelaytime', 'hoverlinkrate', 'on', 'Model'], function (data) {rate = data. hoverlinkrate; movebox (data. hoverlinkposition, Data. hoverlinkoffsetx, Data. hoverlinkoffsety); normalurl = data. hoverlinknormal; delaytime = data. hoverlinkdelaytime; on = data. on; showmodel = data. model; // console. log ("log in content" + on);} function movebox (S, x, y) {// var STR = "Hello world! "; // Var res = Str. substr (1, 4) var A = S. substring (0, S. indexof ('-'), B = S. substr (S. indexof ('-') + 1 );//?? // Console. log (a); // top // console. log (B); // right // container. setattribute ('style', 'z-index: '+ zindex +'; '); container. style [a] = Y + 'px '; // The style contains JSON, so a and B are key container. style [B] = x + 'px '; container. style ['overflow'] = 'scroll '; container. style ['max-width'] = '1450px '; container. style ['max-height'] = '400px '; container. style ['-WebKit-transform'] = 'scale ('+ rate +') '; container. style ['-WebKit-transform- Origin '] = '0px 0px'; // "-WebKit-transform: Scale (0.43);-WebKit-transform-origin: 200px 100px; overflow: scroll "} function addevents () {for (VAR I = currentLength-1; I> = 0; I --) {addevent (A [I]); currentlinks. push (A [I]); // put in the array} function addevent (a) {. addeventlistener ('mouseover', linkmouseover, false); // when Mouseover is triggered, linkmouseover A is called. addeventlistener ('mouseleave ', linkmouseout, false); $ ('body '). on ('click ', Mouseclick);} function linkmouseover (event) {var url = This. href; // This should be a tag // console. log ("client: top->" + event. clienty + "left->" + event. clientx + "offset: top->" + window. pageyoffset + "left->" + window. pagexoffset); container. style ['top'] = event. clienty + 'px 'iner. style ['left'] = event. clientx + 'px '; hovernow = 1; displaytimeout = setTimeout (function () {displaybox (); setTimeout (function () {mouseo Ver (URL) ;}, 1000); // Mouseover (URL) ;}, delaytime)} function linkmouseout (event) {console. log ('now mouseout'); hovernow = 0; cleartimeout (displaytimeout); // prevent the function set with the setTimeout () to execute if (! Container) {// $ ("body "). removechild (container); body. removechild (container);} else {container. style. display = 'none';} function Mouseover (URL) {If (hovernow = 1) {console. log ('now mouseover'); $. post ('HTTP: // gozoom4235.appspot.com/highlight.php', url:url#,function (webdata) {// displaybox (); If (showmodel = 1) {insertlabel (webdata );} else {showword (webdata) ;}}} function mouseclick (event) {cleartimeo Ut (displaytimeout); If (! Container) {// $ ("body "). removechild (container); body. removechild (container);} else {container. style. display = 'none';} function displaybox () {container. innerhtml = "loading ..... "; if (on = 1) {body. appendchild (container); // appendchild adds all previous container information as HTML nodes, and $ (container) is displayed in HTML only ). show ('fast ') ;}} function requesturl (Link) {sendmessage ({hoverlink: 'findurl', URL: link}); // Jason} function Sen Dmessage (Message) {// chrome. runtime. sendmessage (message, empty);} function empty () {}// ======== unknowfunction drawwindow () {// draw a box to display usrl var all = document. getelementsbytagname ('*'); For (VAR I = All. length; I> = 0; I --) {var style = getcomputedstyle (ALL [I]); If (! Style) continue; var z = parseint (style. getpropertyvalue ('z-Index'); If (z> zindex) zindex = z + 1;} VaR _ Container = document. createelement ('div '); // _ label = document. createelement ('div '); // _ button = document. createelement ('button '); // _ button. onclick = function () {// size = size + 0.1; // set (); //}; // _ button2 = document. createelement ('button '); // _ button2.onclick = function () {// Si Ze = size-0.1; // set (); //}; _ container. id = 'hoverlinkiner iner '; _ container. style. zindex = zindex; // _ container. innerhtml = 'loading... '; // _ label. id = 'hoverlinklabel'; // _ label. innerhtml = 'loading... '; // pre-configured display // _label.style.css text = "-WebKit-transform: Scale (1.0);-WebKit-transform-origin: 0px 0px ;"; // For containlabel init // _ container. appendchild (_ label); // containerlabel = _ label; // _ Label becomes a node? // _ Button. id = "buttonlarg"; // _ button2.id = "buttonsmal"; // _ button. style ['background'] = "white"; // _ button. style ['font-color'] = "black"; // _ button. style ['margin-top'] = "5px"; // button = _ button; Container = _ container; // label = _ label;} // function showfinalurl (URL) {// insertlabel (URL); //} function insertlabel (txt) {// TXT = TXT. substring (1, TXT. length-1); container. innerhtml = txt; // embed it into the text (note that ''is not" ") // container. innerhtml = '<button onclick = "zoomout () "> enlarger </button> <input type =" button "id =" button2 "value =" smaller "onclick =" zoomin () "> <div> '+ TXT +' </div> ';} // function set () {// containerlabel.style.css text = containerlabel.style.css text +';-WebKit-transform: scale ('+ size +');-WebKit-transform-origin: 0 0; ';} function showword (webdata) {$. post ('HTTP: // gozoom4235.appspot.com/body.php', specify webdata:webdata#,function (data) {// http: // localhost/body. PHP console. log (data); insertlabel (data) ;}}) (window );
Delete the spam code