2. Compatibility Detector Project Compatibility Detector scans for potential incompatible issues on a web page, for popular desktop browsers(IE, Firefox, Chrome, Opera, etc). The current version launch 14 detector. Compatibility Detectorhttps://chrome.google.com/webstore/detail/fcillahbnhlpombgccogflhmgocfifma Source Codehttps://code.google.com/p/compatibility-detector/
3. Degree of project completion Check the actual document mode in browser Check CSS box model Check new block formatting context and IE hasLayout Check MARQUEE's element Check CENTER tag Check "disabled" attribute Check ': before' and ': after' pseudo-elements Check document.createElement method Check document.all …… the total number of about 30 completed, launch 14. Objectives: Detection W3Help all compatibility root causes.
5. Extensions Features chrome.*API Cross-Origin XMLHttpReques Desktop Notification JavaScriptand DOM API HTML5 <canvas> <audio> <video> …… localStorage Web Database CSS 3 CSS Selector ……
6. Working principle of extensions Extension Process Page Process Background Page Content Script Page DOM IPC Page Script Popup Page IPC Page Process Content Script Page DOM Other HTML Page Page Script
7. Content ScriptProcess Model Content Script Process C++ DOM Object V8 Global Context (EcmaScript Environment) Execution flow ExtensionsDOMHandler Content Script Run Deferrer Can not Access V8 Global Context (EcmaScript Environment) append Global Context Page Script Page Script Process
9. Compatibility Detector Files manifase.json background.html popup.html loader.js base_detection.js framework_shared.js framework.js detectors/*.js Extension Process Page Process Page Process ContentScript Context Page Script Context
10. Message Model Popup.html Other HTML page background.html extension.sendRequest extension.onRequest Page contentScript framewrok.js framework_shared.js Detectors/*.js EventListener framework_shared.js Custom Event dispatch Inject to psge Script page Script loader.js createElement run DOM :: <HTML> <script> chrome_comp_injector () </script>
11. Detector Model Class chrome_comp.CompDetect.declareDetector chrome_comp.CompDetect.ScanDomBaseDetector chrome_comp.CompDetect.NonScanDomBaseDetector Methods constructor checkNode postAnalyze
12. Detector Model Detector Algorithm Detector Algorithm Detector Algorithm addProblem BaseDetector Class postAnalyze(empty) extend constructor NonScanDomBaseDetector Class postAnalyze extend ScanDomBaseDetector Class checkNode document.createNodeIterator for each Nodes
13. JavaScript Hook Model Input Wrap Same Name Native Code Detector Code error ok Continue to other code problems chrome_comp. CompDetect .registerExistingMethodHook chrome_comp. CompDetect .registerExistingPropertyHook
14. ???? How to Start Write Compatibility Detector Code
21. More accurate extract the contents in browsers Kernel Detector Algorithm Detector Algorithm Detector Algorithm IE Bot addProblem WebKit Bot BaseDetector Class constructor NonScanDomBaseDetector Class Browsers Bot postAnalyze Json ScanDomBaseDetector Class Browser API checkNode C++ String implement Desktop app Web app Your test framework PHP ... Local System
22. Compatibility Test Bot Demo D:rogramDataindowsesktopemo>Detect.exe --url=clear_float.html content-type: problems: [{"id":"RM8002","info":{"repeatedCount":6,"occurrences":[{"details":"Problem Ele ment height is 38px","html":["<div id=quot;div1quot; style=quot;zoom:1;quot; expectedproblem s=quot;RM8002quot;> div1 zoom:1; <div style=quot;float:left;quot;>div float:left;</div > <div style=quot;float:right;quot;>div float:right;</div></div>","<div style=quot;f loat:left;quot;>div float:left;</div>"],"stack":""},{"details":"Problem Element hei ght is 16px","html":["<div id=quot;div5quot; style=quot;height:1em;quot; expectedproblems=quot; RM8002quot;> div5 height:1em; <div style=quot;float:left;quot;>div float:left;</div > <div style=quot;float:right;quot;>div float:right;</div></div>","<div style=quot;f loat:left;quot;>div float:left;</div>"],"stack":""}……