SlideShare une entreprise Scribd logo
1  sur  24
Compatibility Detector Tool   of Chrome extensions Tapir   2011-05-07
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/
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.
Chrome extensions
Extensions Features chrome.*API Cross-Origin XMLHttpReques Desktop Notification JavaScriptand DOM API HTML5 <canvas>  <audio> <video> …… localStorage Web Database CSS 3 CSS Selector ……
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
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
Compatibility Detector
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
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>
Detector Model Class chrome_comp.CompDetect.declareDetector chrome_comp.CompDetect.ScanDomBaseDetector chrome_comp.CompDetect.NonScanDomBaseDetector Methods constructor checkNode postAnalyze
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
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
???? How to Start Write Compatibility Detector Code
mainfest.json …… "content_scripts": [   {     "matches": [ "http://*/*", "https://*/*", "file://*" ],     "js": [       "loader.js",       "framework.js",       "framework_shared.js",       "base_detection.js",       "config.js",       "w3help_issues.js",       "non_w3help_issues.js",       // Detector "detectors/sample_check_node.js", ……
addScriptToInject(function() { chrome_comp.CompDetect.declareDetector( 'sample_check_node', chrome_comp.CompDetect.ScanDomBaseDetector, functionconstructor() {   this.CHECK_TAG_NAME = {SPAN: true, DIV: true, TALBE: true};   this.addProblem = function (node) {     node.style.backgroundColor = 'red';   }; }, // constructor functioncheckNode(node, context) {   if (Node.ELEMENT_NODE != node.nodeType || context.isDisplayNone())     return;   if (node.tagName in this.CHECK_TAG_NAME) {     if (node.hasAttribute('width') || node.hasAttribute('height'))       this.addProblem(node);   } } ); // declareDetector }); ScanDomBaseDetector checkNode
addScriptToInject(function() { chrome_comp.CompDetect.declareDetector( 'sample_post_analyze', chrome_comp.CompDetect.NonScanDomBaseDetector, null, // constructor functionpostAnalyze() {   var m = chrome_comp.documentMode;    m.hasCommentBeforeDTD && log('There has Comment before DOCTYPE');   m.hasConditionalCommentBeforeDTD && log('There has IE conditional comment before DOCTYPE');   m.isUnusualDocType && log('There is unknown DOCTYPE');   (document.querySelectorAll('meta').length == 0) && log('This page has no Meta tag');   functionlog(str) {     var t = document.createTextNode(str),p = document.createElement('p');     p.appendChild(t);     document.body.appendChild(p);  } } ); // declareDetector }); NonScanDomBaseDetector postAnalyze
addScriptToInject(function() { chrome_comp.CompDetect.declareDetector( 'sample_hook', chrome_comp.CompDetect.NonScanDomBaseDetector, functionconstructor() { var This = this;   this.log = function(str) {     var t = document.createTextNode(str),p = document.createElement('p');     p.appendChild(t);     document.body.appendChild(p);   };   this.evalHandler_ = function (result, originalArguments, callStack) {     if (originalArguments[0].indexOf('var ') == 0)       window.addEventListener('load',function() {           This.log('Performed using the eval method ' + originalArguments[0] + 'statement.');       },false)   }; }, function setUp() {   chrome_comp.CompDetect.registerExistingMethodHook(window, 'eval', this.evalHandler_); }, function cleanUp() {   chrome_comp.CompDetect.unregisterExistingMethodHook(window, 'eval', this.evalHandler_); } ); // declareDetector }); NonScanDomBaseDetector Method Hook
addScriptToInject(function() { chrome_comp.CompDetect.declareDetector( 'sample_hook_2', chrome_comp.CompDetect.NonScanDomBaseDetector, functionconstructor() {   var This = this;   this.log = function(str) {     var t = document.createTextNode(str),p = document.createElement('p');     p.appendChild(t);     document.body.appendChild(p);   };   this.handler_ =function(oldValue, newValue, reason) {     if (reason == 'get') {       This.log('Get document.documentMode value is ' + oldValue);     }     if (reason == 'set') {       This.log('Set document.documentMode value is ' + newValue);     }  }; }, function setUp() {   chrome_comp.CompDetect.registerSimplePropertyHook(document, 'documentMode', this.handler_); }, function cleanUp() {   chrome_comp.CompDetect.registerSimplePropertyHook(document, 'documentMode', this.handler_); } ); // declareDetector }); NonScanDomBaseDetector Property Hook
Build Your Own Test Framework Multiplexing Detector Files
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
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":""}……
Q&A Mark huang, Google Chrome team
Finished Thanks Zzzz... Tapir

Contenu connexe

Tendances

Web ui tests examples with selenide, nselene, selene & capybara
Web ui tests examples with  selenide, nselene, selene & capybaraWeb ui tests examples with  selenide, nselene, selene & capybara
Web ui tests examples with selenide, nselene, selene & capybaraIakiv Kramarenko
 
Testing in JavaScript - August 2018 - WebElement Bardejov
Testing in JavaScript - August 2018 - WebElement BardejovTesting in JavaScript - August 2018 - WebElement Bardejov
Testing in JavaScript - August 2018 - WebElement BardejovMarian Rusnak
 
Building Progressive Web Apps for Windows devices
Building Progressive Web Apps for Windows devicesBuilding Progressive Web Apps for Windows devices
Building Progressive Web Apps for Windows devicesWindows Developer
 
Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015Iakiv Kramarenko
 
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]Iakiv Kramarenko
 
Avinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPressAvinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPresswpnepal
 
AngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesAngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesRainer Stropek
 
Effective C++/WinRT for UWP and Win32
Effective C++/WinRT for UWP and Win32Effective C++/WinRT for UWP and Win32
Effective C++/WinRT for UWP and Win32Windows Developer
 
Testing ASP.net Web Applications using Ruby
Testing ASP.net Web Applications using RubyTesting ASP.net Web Applications using Ruby
Testing ASP.net Web Applications using RubyBen Hall
 
49368010 projectreportontraininganddevelopment(1)
49368010 projectreportontraininganddevelopment(1)49368010 projectreportontraininganddevelopment(1)
49368010 projectreportontraininganddevelopment(1)Kritika910
 
Redux for ReactJS Programmers
Redux for ReactJS ProgrammersRedux for ReactJS Programmers
Redux for ReactJS ProgrammersDavid Rodenas
 
Introduction to Protractor
Introduction to ProtractorIntroduction to Protractor
Introduction to ProtractorJie-Wei Wu
 
What static analyzers can do that programmers and testers cannot
What static analyzers can do that programmers and testers cannotWhat static analyzers can do that programmers and testers cannot
What static analyzers can do that programmers and testers cannotAndrey Karpov
 
Kiss PageObjects [01-2017]
Kiss PageObjects [01-2017]Kiss PageObjects [01-2017]
Kiss PageObjects [01-2017]Iakiv Kramarenko
 
Workshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScriptWorkshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScriptVisual Engineering
 
Unit testing PHP apps with PHPUnit
Unit testing PHP apps with PHPUnitUnit testing PHP apps with PHPUnit
Unit testing PHP apps with PHPUnitMichelangelo van Dam
 

Tendances (20)

Web ui tests examples with selenide, nselene, selene & capybara
Web ui tests examples with  selenide, nselene, selene & capybaraWeb ui tests examples with  selenide, nselene, selene & capybara
Web ui tests examples with selenide, nselene, selene & capybara
 
Testing in JavaScript - August 2018 - WebElement Bardejov
Testing in JavaScript - August 2018 - WebElement BardejovTesting in JavaScript - August 2018 - WebElement Bardejov
Testing in JavaScript - August 2018 - WebElement Bardejov
 
Building Progressive Web Apps for Windows devices
Building Progressive Web Apps for Windows devicesBuilding Progressive Web Apps for Windows devices
Building Progressive Web Apps for Windows devices
 
Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015Polyglot automation - QA Fest - 2015
Polyglot automation - QA Fest - 2015
 
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]
Selenide alternative in Python - Introducing Selene [SeleniumCamp 2016]
 
Avinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPressAvinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPress
 
AngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesAngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile Services
 
Effective C++/WinRT for UWP and Win32
Effective C++/WinRT for UWP and Win32Effective C++/WinRT for UWP and Win32
Effective C++/WinRT for UWP and Win32
 
Testing ASP.net Web Applications using Ruby
Testing ASP.net Web Applications using RubyTesting ASP.net Web Applications using Ruby
Testing ASP.net Web Applications using Ruby
 
JS and patterns
JS and patternsJS and patterns
JS and patterns
 
49368010 projectreportontraininganddevelopment(1)
49368010 projectreportontraininganddevelopment(1)49368010 projectreportontraininganddevelopment(1)
49368010 projectreportontraininganddevelopment(1)
 
Redux for ReactJS Programmers
Redux for ReactJS ProgrammersRedux for ReactJS Programmers
Redux for ReactJS Programmers
 
Introduction to Protractor
Introduction to ProtractorIntroduction to Protractor
Introduction to Protractor
 
TDD per Webapps
TDD per WebappsTDD per Webapps
TDD per Webapps
 
What static analyzers can do that programmers and testers cannot
What static analyzers can do that programmers and testers cannotWhat static analyzers can do that programmers and testers cannot
What static analyzers can do that programmers and testers cannot
 
Your code are my tests
Your code are my testsYour code are my tests
Your code are my tests
 
Kiss PageObjects [01-2017]
Kiss PageObjects [01-2017]Kiss PageObjects [01-2017]
Kiss PageObjects [01-2017]
 
Protractor Training in Pune by QuickITDotnet
Protractor Training in Pune by QuickITDotnet Protractor Training in Pune by QuickITDotnet
Protractor Training in Pune by QuickITDotnet
 
Workshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScriptWorkshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScript
 
Unit testing PHP apps with PHPUnit
Unit testing PHP apps with PHPUnitUnit testing PHP apps with PHPUnit
Unit testing PHP apps with PHPUnit
 

Similaire à Compatibility Detector Tool of Chrome extensions

Non Conventional Android Programming (English)
Non Conventional Android Programming (English)Non Conventional Android Programming (English)
Non Conventional Android Programming (English)Davide Cerbo
 
Spicy javascript: Create your first Chrome extension for web analytics QA
Spicy javascript: Create your first Chrome extension for web analytics QASpicy javascript: Create your first Chrome extension for web analytics QA
Spicy javascript: Create your first Chrome extension for web analytics QAAlban Gérôme
 
Test strategy for web development
Test strategy for web developmentTest strategy for web development
Test strategy for web developmentalice yang
 
Performance Metrics in a Day with Selenium
Performance Metrics in a Day with SeleniumPerformance Metrics in a Day with Selenium
Performance Metrics in a Day with SeleniumMark Watson
 
Protractor framework architecture with example
Protractor framework architecture with exampleProtractor framework architecture with example
Protractor framework architecture with exampleshadabgilani
 
Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09Steve Souders
 
Pragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptPragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptdavejohnson
 
SXSW: Even Faster Web Sites
SXSW: Even Faster Web SitesSXSW: Even Faster Web Sites
SXSW: Even Faster Web SitesSteve Souders
 
Google在Web前端方面的经验
Google在Web前端方面的经验Google在Web前端方面的经验
Google在Web前端方面的经验yiditushe
 
Bonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsBonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsFrancois Zaninotto
 
Future of Web Apps: Google Gears
Future of Web Apps: Google GearsFuture of Web Apps: Google Gears
Future of Web Apps: Google Gearsdion
 
Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineAndy McKay
 
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageabilityDaniel Fisher
 
Scti 2011 minicurso jquery
Scti 2011 minicurso jqueryScti 2011 minicurso jquery
Scti 2011 minicurso jqueryciberglo
 
eXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction TrainingeXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction TrainingHoat Le
 
Apache Aries Blog Sample
Apache Aries Blog SampleApache Aries Blog Sample
Apache Aries Blog SampleSkills Matter
 

Similaire à Compatibility Detector Tool of Chrome extensions (20)

Non Conventional Android Programming (English)
Non Conventional Android Programming (English)Non Conventional Android Programming (English)
Non Conventional Android Programming (English)
 
Spicy javascript: Create your first Chrome extension for web analytics QA
Spicy javascript: Create your first Chrome extension for web analytics QASpicy javascript: Create your first Chrome extension for web analytics QA
Spicy javascript: Create your first Chrome extension for web analytics QA
 
Test strategy for web development
Test strategy for web developmentTest strategy for web development
Test strategy for web development
 
Performance Metrics in a Day with Selenium
Performance Metrics in a Day with SeleniumPerformance Metrics in a Day with Selenium
Performance Metrics in a Day with Selenium
 
You Know WebOS
You Know WebOSYou Know WebOS
You Know WebOS
 
Protractor framework architecture with example
Protractor framework architecture with exampleProtractor framework architecture with example
Protractor framework architecture with example
 
UNO based ODF Toolkit API
UNO based ODF Toolkit APIUNO based ODF Toolkit API
UNO based ODF Toolkit API
 
Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09
 
Pragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptPragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScript
 
Sxsw 20090314
Sxsw 20090314Sxsw 20090314
Sxsw 20090314
 
SXSW: Even Faster Web Sites
SXSW: Even Faster Web SitesSXSW: Even Faster Web Sites
SXSW: Even Faster Web Sites
 
Google在Web前端方面的经验
Google在Web前端方面的经验Google在Web前端方面的经验
Google在Web前端方面的经验
 
Bonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsBonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node js
 
Future of Web Apps: Google Gears
Future of Web Apps: Google GearsFuture of Web Apps: Google Gears
Future of Web Apps: Google Gears
 
Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App Engine
 
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
 
Scti 2011 minicurso jquery
Scti 2011 minicurso jqueryScti 2011 minicurso jquery
Scti 2011 minicurso jquery
 
eXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction TrainingeXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction Training
 
Google Gears
Google GearsGoogle Gears
Google Gears
 
Apache Aries Blog Sample
Apache Aries Blog SampleApache Aries Blog Sample
Apache Aries Blog Sample
 

Plus de Kai Cui

做网站需要知道哪些事
做网站需要知道哪些事做网站需要知道哪些事
做网站需要知道哪些事Kai Cui
 
July.2011.w3ctech
July.2011.w3ctechJuly.2011.w3ctech
July.2011.w3ctechKai Cui
 
Yui3在美团 2
Yui3在美团 2Yui3在美团 2
Yui3在美团 2Kai Cui
 
Javascript template
Javascript templateJavascript template
Javascript templateKai Cui
 
谈团队协作的基情和兼情
谈团队协作的基情和兼情谈团队协作的基情和兼情
谈团队协作的基情和兼情Kai Cui
 
腾讯网Web页面设计规范
腾讯网Web页面设计规范腾讯网Web页面设计规范
腾讯网Web页面设计规范Kai Cui
 

Plus de Kai Cui (6)

做网站需要知道哪些事
做网站需要知道哪些事做网站需要知道哪些事
做网站需要知道哪些事
 
July.2011.w3ctech
July.2011.w3ctechJuly.2011.w3ctech
July.2011.w3ctech
 
Yui3在美团 2
Yui3在美团 2Yui3在美团 2
Yui3在美团 2
 
Javascript template
Javascript templateJavascript template
Javascript template
 
谈团队协作的基情和兼情
谈团队协作的基情和兼情谈团队协作的基情和兼情
谈团队协作的基情和兼情
 
腾讯网Web页面设计规范
腾讯网Web页面设计规范腾讯网Web页面设计规范
腾讯网Web页面设计规范
 

Dernier

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 

Dernier (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 

Compatibility Detector Tool of Chrome extensions

  • 1. Compatibility Detector Tool of Chrome extensions Tapir 2011-05-07
  • 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
  • 15. mainfest.json …… "content_scripts": [ { "matches": [ "http://*/*", "https://*/*", "file://*" ], "js": [ "loader.js", "framework.js", "framework_shared.js", "base_detection.js", "config.js", "w3help_issues.js", "non_w3help_issues.js", // Detector "detectors/sample_check_node.js", ……
  • 16. addScriptToInject(function() { chrome_comp.CompDetect.declareDetector( 'sample_check_node', chrome_comp.CompDetect.ScanDomBaseDetector, functionconstructor() { this.CHECK_TAG_NAME = {SPAN: true, DIV: true, TALBE: true}; this.addProblem = function (node) { node.style.backgroundColor = 'red'; }; }, // constructor functioncheckNode(node, context) { if (Node.ELEMENT_NODE != node.nodeType || context.isDisplayNone()) return; if (node.tagName in this.CHECK_TAG_NAME) { if (node.hasAttribute('width') || node.hasAttribute('height')) this.addProblem(node); } } ); // declareDetector }); ScanDomBaseDetector checkNode
  • 17. addScriptToInject(function() { chrome_comp.CompDetect.declareDetector( 'sample_post_analyze', chrome_comp.CompDetect.NonScanDomBaseDetector, null, // constructor functionpostAnalyze() { var m = chrome_comp.documentMode; m.hasCommentBeforeDTD && log('There has Comment before DOCTYPE'); m.hasConditionalCommentBeforeDTD && log('There has IE conditional comment before DOCTYPE'); m.isUnusualDocType && log('There is unknown DOCTYPE'); (document.querySelectorAll('meta').length == 0) && log('This page has no Meta tag'); functionlog(str) { var t = document.createTextNode(str),p = document.createElement('p'); p.appendChild(t); document.body.appendChild(p); } } ); // declareDetector }); NonScanDomBaseDetector postAnalyze
  • 18. addScriptToInject(function() { chrome_comp.CompDetect.declareDetector( 'sample_hook', chrome_comp.CompDetect.NonScanDomBaseDetector, functionconstructor() { var This = this; this.log = function(str) { var t = document.createTextNode(str),p = document.createElement('p'); p.appendChild(t); document.body.appendChild(p); }; this.evalHandler_ = function (result, originalArguments, callStack) { if (originalArguments[0].indexOf('var ') == 0) window.addEventListener('load',function() { This.log('Performed using the eval method ' + originalArguments[0] + 'statement.'); },false) }; }, function setUp() { chrome_comp.CompDetect.registerExistingMethodHook(window, 'eval', this.evalHandler_); }, function cleanUp() { chrome_comp.CompDetect.unregisterExistingMethodHook(window, 'eval', this.evalHandler_); } ); // declareDetector }); NonScanDomBaseDetector Method Hook
  • 19. addScriptToInject(function() { chrome_comp.CompDetect.declareDetector( 'sample_hook_2', chrome_comp.CompDetect.NonScanDomBaseDetector, functionconstructor() { var This = this; this.log = function(str) { var t = document.createTextNode(str),p = document.createElement('p'); p.appendChild(t); document.body.appendChild(p); }; this.handler_ =function(oldValue, newValue, reason) { if (reason == 'get') { This.log('Get document.documentMode value is ' + oldValue); } if (reason == 'set') { This.log('Set document.documentMode value is ' + newValue); } }; }, function setUp() { chrome_comp.CompDetect.registerSimplePropertyHook(document, 'documentMode', this.handler_); }, function cleanUp() { chrome_comp.CompDetect.registerSimplePropertyHook(document, 'documentMode', this.handler_); } ); // declareDetector }); NonScanDomBaseDetector Property Hook
  • 20. Build Your Own Test Framework Multiplexing Detector Files
  • 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":""}……
  • 23. Q&A Mark huang, Google Chrome team