Map terms Azure to AWS

Display the corresponding AWS-related term near the Azure-related term on the Microsoft documentation site.

  1. // ==UserScript==
  2. // @name Map terms Azure to AWS
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.304
  5. // @description Display the corresponding AWS-related term near the Azure-related term on the Microsoft documentation site.
  6. // @author uemuram
  7. // @match https://docs.microsoft.com/*
  8. // @match https://qiita.com/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function main(w) {
  13. 'use strict';
  14.  
  15. // マッピング
  16. const termMappings = [
  17. { 'azure': 'Application Insights', 'aws': 'CloudWatch' },
  18. { 'azure': 'Cost Management', 'aws': 'Cost Explorer' },
  19. { 'azure': 'File Sync', 'aws': 'DataSync' },
  20. { 'azure': 'Azure Marketplace', 'aws': 'AWS Marketplace' },
  21. { 'azure': 'CycleCloud', 'aws': 'Parallel Cluster' },
  22. { 'azure': 'Machine Learning', 'aws': 'SageMaker' },
  23. { 'azure': 'Machine Learning Studio', 'aws': 'SageMaker' },
  24. { 'azure': 'Bot Framework', 'aws': 'Alexa Skills Kit' },
  25. { 'azure': 'Speech Services', 'aws': 'Amazon Lex' },
  26. { 'azure': 'Language Understanding', 'aws': 'Amazon Lex' },
  27. { 'azure': 'Speech Services', 'aws': 'Amazon Polly、Amazon Transcribe' },
  28. { 'azure': 'Cognitive Services', 'aws': 'Amazon Rekognition' },
  29. { 'azure': 'Cognitive Search', 'aws': 'CloudSearch' },
  30. { 'azure': 'Azure 仮想アシスタント', 'aws': 'Alexa Skills Kit' },
  31. { 'azure': '仮想アシスタント', 'aws': 'Alexa Skills Kit' },
  32. { 'azure': 'Synapse Analytics', 'aws': 'Redshift' },
  33. { 'azure': 'Databricks', 'aws': 'EMR' },
  34. { 'azure': 'HDInsight', 'aws': 'EMR' },
  35. { 'azure': 'Data Lake Storage', 'aws': 'EMR' },
  36. { 'azure': 'Data Factory', 'aws': 'データ パイプライン、AWS Glue' },
  37. { 'azure': 'Data Catalog', 'aws': 'AWS Glue' },
  38. { 'azure': 'Stream Analytics', 'aws': 'Kinesis Analytics' },
  39. { 'azure': 'Data Lake Analytics', 'aws': 'Kinesis Analytics' },
  40. { 'azure': 'Data Lake Store', 'aws': 'Kinesis Analytics' },
  41. { 'azure': 'Data Share', 'aws': 'Lake Formation' },
  42. { 'azure': 'Power BI', 'aws': 'QuickSight' },
  43. { 'azure': 'Azure Search', 'aws': 'CloudSearch' },
  44. { 'azure': 'Azure Data Lake Analytics', 'aws': 'Amazon Athena' },
  45. { 'azure': 'Virtual Machine Scale Sets', 'aws': 'AWS Auto Scaling' },
  46. { 'azure': 'Virtual Machines', 'aws': 'Elastic Compute Cloud (EC2) インスタンス' },
  47. { 'azure': 'Azure Batch', 'aws': 'AWS Batch' },
  48. { 'azure': 'VMware by CloudSimple', 'aws': 'VMware Cloud on AWS' },
  49. { 'azure': 'Container Instances', 'aws': 'Elastic Container Service (ECS)' },
  50. { 'azure': 'Container Registry', 'aws': 'Elastic Container Registry' },
  51. { 'azure': 'Kubernetes Service', 'aws': 'Elastic Kubernetes Service (EKS)' },
  52. { 'azure': 'Service Fabric Mesh', 'aws': 'App Mesh' },
  53. { 'azure': 'Azure Functions', 'aws': 'Lambda' },
  54. { 'azure': 'SQL Database', 'aws': 'RDS' },
  55. { 'azure': 'Database for MySQL', 'aws': 'RDS' },
  56. { 'azure': 'Database for PostgreSQL', 'aws': 'RDS' },
  57. { 'azure': 'Cosmos DB', 'aws': 'DynamoDB、SimpleDB、Amazon DocumentDB' },
  58. { 'azure': 'CosmosDB', 'aws': 'DynamoDB、SimpleDB、Amazon DocumentDB' },
  59. { 'azure': 'Table Storage', 'aws': 'DynamoDB' },
  60. { 'azure': 'Cache for Redis', 'aws': 'ElastiCache' },
  61. { 'azure': 'Database Migration Service', 'aws': 'AWS Database Migration Service' },
  62. { 'azure': 'Azure Monitor', 'aws': 'CloudWatch、AWS X-Ray' },
  63. { 'azure': 'DevOps', 'aws': 'CodeDeploy、CodeCommit、CodePipeline' },
  64. { 'azure': '開発者ツール', 'aws': 'AWS 開発者ツール' },
  65. { 'azure': 'DevOps', 'aws': 'AWS CodeBuild' },
  66. { 'azure': 'CLI', 'aws': 'コマンド ライン インターフェイス' },
  67. { 'azure': 'PowerShell', 'aws': 'コマンド ライン インターフェイス' },
  68. { 'azure': 'Automation', 'aws': 'OpsWorks (Chef ベース)' },
  69. { 'azure': 'Resource Manager', 'aws': 'CloudFormation' },
  70. { 'azure': 'VM 拡張機能', 'aws': 'CloudFormation' },
  71. { 'azure': 'Azure Automation', 'aws': 'CloudFormation' },
  72. { 'azure': 'IoT Hub', 'aws': 'AWS IoT' },
  73. { 'azure': 'IoT Edge', 'aws': 'AWS Greengrass' },
  74. { 'azure': 'Event Hubs', 'aws': 'Kinesis Firehose、Kinesis Streams' },
  75. { 'azure': 'Digital Twins', 'aws': 'AWS IoT Things Graph' },
  76. { 'azure': 'Azure Advisor', 'aws': 'Trusted Advisor' },
  77. { 'azure': 'Billing API', 'aws': 'AWS Usage and Billing Report' },
  78. { 'azure': 'Azure Portal', 'aws': 'AWS Management Console' },
  79. { 'azure': 'Azure Migrate', 'aws': 'AWS Application Discovery Service' },
  80. { 'azure': 'Azure Monitor', 'aws': 'Amazon EC2 Systems Manager' },
  81. { 'azure': 'Resource Health', 'aws': 'AWS Personal Health Dashboard' },
  82. { 'azure': 'Queue Storage', 'aws': 'Simple Queue Service (SQS)' },
  83. { 'azure': 'Service Bus', 'aws': 'Simple Queue Service (SQS)' },
  84. { 'azure': 'Event Grid', 'aws': 'Simple Notification Service' },
  85. { 'azure': 'App Center', 'aws': 'Mobile Hub、Mobile SDK、Cognito、AWS Device Farm、Mobile Analytics' },
  86. { 'azure': 'Xamarin アプリ', 'aws': 'Mobile Hub' },
  87. { 'azure': 'Virtual Network', 'aws': 'Virtual Private Cloud (VPC)' },
  88. { 'azure': '仮想ネットワーク', 'aws': 'Virtual Private Cloud (VPC)' },
  89. { 'azure': 'VPN Gateway', 'aws': 'AWS VPN Gateway' },
  90. { 'azure': 'DNS', 'aws': 'Route 53' },
  91. { 'azure': 'Traffic Manager', 'aws': 'Route 53' },
  92. { 'azure': 'ExpressRoute', 'aws': 'Direct Connect' },
  93. { 'azure': 'Load Balancer', 'aws': 'Network Load Balancer' },
  94. { 'azure': 'Application Gateway', 'aws': 'Application Load Balancer' },
  95. { 'azure': 'PrivateLink', 'aws': 'ネットワークの分離' },
  96. { 'azure': 'Azure Active Directory', 'aws': 'Identity and Access Management (IAM)' },
  97. { 'azure': 'ロール ベースのアクセス制御', 'aws': 'Identity and Access Management (IAM)' },
  98. { 'azure': 'サブスクリプション管理 + Azure RBAC', 'aws': 'AWS Organizations' },
  99. { 'azure': 'Multi-Factor Authentication', 'aws': 'Multi-Factor Authentication' },
  100. { 'azure': 'Azure Active Directory Domain Services', 'aws': 'AWS Directory Service' },
  101. { 'azure': 'Azure Active Directory B2C', 'aws': 'Cognito' },
  102. { 'azure': 'Azure Policy', 'aws': 'AWS Organizations' },
  103. { 'azure': '管理グループ', 'aws': 'AWS Organizations' },
  104. { 'azure': 'Azure Storage Service Encryption', 'aws': 'Amazon S3 Key Management Service を使用したサーバー側の暗号化' },
  105. { 'azure': 'Key Vault', 'aws': 'キー管理サービス (KMS)、CloudHSM' },
  106. { 'azure': 'Application Gateway - Web アプリケーション ファイアウォール', 'aws': 'Web アプリケーション ファイアウォール' },
  107. { 'azure': 'Azure Firewall', 'aws': 'Web アプリケーション ファイアウォール' },
  108. { 'azure': 'セキュリティ センター', 'aws': 'Inspector' },
  109. { 'azure': 'ポータルで使用可能な App Service 証明書', 'aws': 'Certificate Manager' },
  110. { 'azure': 'Advanced Threat Protection', 'aws': 'GuardDuty' },
  111. { 'azure': 'Service Trust Portal', 'aws': 'AWS Artifact' },
  112. { 'azure': 'DDoS Protection サービス', 'aws': 'AWS Shield' },
  113. { 'azure': 'BLOB Storage', 'aws': 'Simple Storage Services (S3)' },
  114. { 'azure': 'マネージド ディスク', 'aws': 'Elastic Block Store (EBS)' },
  115. { 'azure': 'Azure Files', 'aws': 'Elastic File System' },
  116. { 'azure': 'Storage クール層', 'aws': 'S3 Infrequent Access (IA)' },
  117. { 'azure': 'Storage アーカイブ アクセス層', 'aws': 'S3 Glacier' },
  118. { 'azure': 'Azure Backup', 'aws': 'AWS Backup' },
  119. { 'azure': 'StorSimple', 'aws': 'Storage Gateway' },
  120. { 'azure': 'Import/Export', 'aws': 'AWS Import/Export ディスク' },
  121. { 'azure': 'Data Box', 'aws': 'AWS Import/Export Snowball、Snowball Edge、Snowmobile' },
  122. { 'azure': 'App Service', 'aws': 'Elastic Beanstalk' },
  123. { 'azure': 'API Management', 'aws': 'API Gateway' },
  124. { 'azure': 'Content Delivery Network', 'aws': 'CloudFront' },
  125. { 'azure': 'Front Door', 'aws': 'Global Accelerator' },
  126. { 'azure': 'Logic Apps', 'aws': 'AWS Step Functions' },
  127. { 'azure': 'Office 365', 'aws': 'Amazon WorkMail、Amazon WorkDocs' },
  128. { 'azure': 'PlayFab', 'aws': 'GameLift、GameSparks' },
  129. { 'azure': 'Media Services', 'aws': 'Elastic Transcoder' },
  130. { 'azure': 'Logic Apps', 'aws': 'Simple Workflow Service (SWF)' },
  131. { 'azure': 'Azure Stack', 'aws': 'Outposts' },
  132. { 'azure': 'Azure DDoS Protection', 'aws': 'AWS Shield' },
  133. { 'azure': 'Network Watcher', 'aws': 'AWS Transit Gateway Network Manager' },
  134. { 'azure': 'Notification Hubs', 'aws': 'Amazon Pinpoint' },
  135. ]
  136.  
  137. // ヒットした部分を加工する
  138. let replaceTermString = function (str) {
  139. for (let i = 0; i < termMappings.length; i++) {
  140. let index = str.toLowerCase().indexOf(termMappings[i].azure.toLowerCase());
  141. if (index >= 0) {
  142. let beforeStr = str.substring(0, index);
  143. let targetTerm = str.substring(index, index + termMappings[i].azure.length);
  144. let afterStr = str.substring(index + termMappings[i].azure.length);
  145. return replaceTermString(beforeStr)
  146. + '<div class="tooltip">' + targetTerm + "<span>" + termMappings[i].aws + '</span></div>'
  147. + replaceTermString(afterStr);
  148. }
  149. }
  150. return str;
  151. }
  152.  
  153. // 子要素を走査し、テキストノード(nodeType=3)であれば、書き換えを行う
  154. let replaceTerm = function (r) {
  155. let children = r.childNodes;
  156. let l = children.length;
  157. for (let i = 0; i < l; i++) {
  158. let child = (children[i]);
  159. if (child.nodeType == 3 && !/^[ \n\t]+$/.test(child.nodeValue) && child.nodeValue.length > 0) {
  160. let newStr = replaceTermString(child.nodeValue);
  161. // 書き換えが発生した場合はDOMを変更
  162. if (newStr !== child.nodeValue) {
  163. let newSpan = document.createElement("span");
  164. newSpan.innerHTML = newStr;
  165. r.insertBefore(newSpan, child);
  166. child.remove();
  167. }
  168. } else {
  169. replaceTerm(child);
  170. }
  171. }
  172. }
  173.  
  174. // スタイル追加
  175. let style = document.createElement("style");
  176. document.head.appendChild(style);
  177. let sheet = style.sheet;
  178. sheet.insertRule("div.tooltip {display:inline; border-bottom:solid 1px #87CEFA}", 0);
  179. sheet.insertRule("div.tooltip span {display:none; padding:5px; margin:10px 0 0 0px;}", 1);
  180. sheet.insertRule("div.tooltip:hover span {display:inline; position:absolute; border:1px solid #CCC; border-radius:5px; background:#F7F7F7; color:#666; font-size:12px; line-height:1.6em;}", 2);
  181.  
  182. var o, i;
  183. //フレームが複数ある場合を考慮してmainを再帰的に実行
  184. while (o = w.frames[i++]) try { main(o) } catch (o) { }
  185. replaceTerm(w.document.body);
  186. })(window);