MCPcopy
hub / github.com/52cik/github-hans / getPage

Function getPage

main.js:82–95  ·  view source on GitHub ↗

* 获取翻译页面

()

Source from the content-addressed store, hash-verified

80 * 获取翻译页面
81 */
82 function getPage() {
83 // 先匹配 body 的 class
84 var page = document.body.className.match(I18N.conf.rePageClass);
85
86 if (!page) { // 扩展 pathname 匹配
87 page = location.pathname.match(I18N.conf.rePagePath);
88 }
89
90 if (!page) { // 扩展 url 匹配
91 page = location.href.match(I18N.conf.rePageUrl);
92 }
93
94 return page ? page[1] : false; // 取页面 key
95 }
96
97 /**
98 * 翻译页面标题

Callers 1

main.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected