{"id":171565,"date":"2013-03-05T11:19:04","date_gmt":"2013-03-05T07:19:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=171565"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=171565","title":{"rendered":"<span class=\"post_title\">\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f Google Chrome: \u0434\u0435\u043b\u0430\u0435\u043c \u0433\u043e\u0440\u044f\u0447\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0445\u0430\u0431\u0440\u0430\u0432\u0447\u0430\u043d\u0435.<br \/>  \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e \u0441\u0435\u0440\u0438\u044e \u043f\u043e\u0441\u0442\u043e\u0432 \u0441 \u043b\u0438\u0447\u043d\u044b\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0438 \u0441\u043e\u0432\u0435\u0442\u0430\u043c\u0438 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 Google Chrome.<br \/>  \u0412 \u044d\u0442\u043e\u043c \u0432\u044b\u043f\u0443\u0441\u043a\u0435 \u2013 \u00ab\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435\u00bb \u0433\u043e\u0440\u044f\u0447\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0418\u0442\u0430\u043a, \u0437\u0430\u0434\u0430\u0447\u0430 \u2013 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0439 \u043a\u043b\u0430\u0432\u0438\u0448 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a\u0430\u0436\u0434\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043f\u043e\u0434 \u0441\u0435\u0431\u044f.<br \/>  \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043d\u0435\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u0433\u043e\u0440\u044f\u0447\u0438\u0445 \u043a\u043b\u0430\u0432\u0438\u0448.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0423\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u0435<\/b><\/p>\n<div class=\"spoiler_text\">\u0422\u0430\u043a \u0431\u044b\u043b\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043c\u043e\u0438\u0445 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439, \u0442\u0430\u043a \u044f \u0441\u0447\u0438\u0442\u0430\u043b \u0434\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438. \u0421\u0435\u0439\u0447\u0430\u0441 API \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u043b\u043e\u0441\u044c, \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434. \u041d\u043e \u043e\u043d\u0438 \u0436\u0451\u0441\u0442\u043a\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435 \u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0439 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438. \u0422\u0430\u043a\u0436\u0435, \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0433\u043e\u0440\u044f\u0447\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u0434\u043b\u044f \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u043e\u043a\u043e\u043d \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439.<br \/>  \u042d\u0442\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u043f\u043e\u0441\u0442\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e \u0432 Google \u0438 <a href=\"http:\/\/developer.chrome.com\/extensions\/commands.html\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e<\/a>.<\/div>\n<\/div>\n<p>  \u041d\u043e \u0437\u0430\u0434\u0430\u0447\u0443 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043d\u0430\u0436\u0430\u0442\u0438\u0439 \u043a\u043b\u0430\u0432\u0438\u0448 \u0432\u043e \u0432\u0441\u0435 \u043e\u043a\u043d\u0430 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430. \u042d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0435\u043d, \u0442\u0430\u043a \u043a\u0430\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0444\u043e\u043a\u0443\u0441\u0430 \u0432 \u0442\u0435\u043b\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430, \u043d\u043e \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d.<br \/>  <b>\u0412\u0430\u0436\u043d\u043e.<\/b> \u041d\u0443\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0433\u043e\u0440\u044f\u0447\u0438\u0445 \u043a\u043b\u0430\u0432\u0438\u0448 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043b\u0438\u043a\u0430 Ctrl+\u0446\u0438\u0444\u0440\u0430 \u0441 preventDefault, \u0442\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u0433\u043e\u0440\u044f\u0447\u0430\u044f \u043a\u043b\u0430\u0432\u0438\u0448\u0430 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0430\u043c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0444\u043e\u043a\u0443\u0441\u0430 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435 \u0441 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c. \u041e\u0431 \u044d\u0442\u043e\u043c \u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0435\u0441\u043b\u0438 \u0435\u043c\u0443 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u043d\u0434\u0438\u0432\u0438\u0434\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0439.<\/p>\n<p>  \u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c content-script, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c\u0441\u044f \u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435, \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0432 background-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f, \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0439 \u043a\u043b\u0430\u0432\u0438\u0448. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043e\u0444\u043e\u0440\u043c\u0438\u0442\u044c \u044d\u0442\u043e \u0432 \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c\u043e\u043c \u0432\u0438\u0434\u0435 \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c.<\/p>\n<p>  \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u0441\u0451 \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<h6>mainfest.json<\/h6>\n<pre><code class=\"javascript\">{ \t... \t&quot;content_scripts&quot;: [ { \t\t&quot;all_frames&quot;: true,\t\/\/\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u043c\u043e\u0433\u0443\u0442 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0444\u043e\u043a\u0443\u0441 \u0443\u0439\u0434\u0451\u0442 \u0432 iframe \t\t&quot;js&quot;: [&quot;js\/hotkeys.js&quot; ],\t\/\/\u0441\u043a\u0440\u0438\u043f\u0442, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0433\u043e\u0440\u044f\u0447\u0438\u0445 \u043a\u043b\u0430\u0432\u0438\u0448 \t\t&quot;matches&quot;: [ &quot;http:\/\/*\/*&quot;, &quot;https:\/\/*\/*&quot; ],\t\/\/\u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430 \u0432\u0441\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \t\t&quot;run_at&quot;: &quot;document_end&quot; \t} ], \t... <\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u0432\u0441\u0451 \u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u041f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0432\u043e \u0432\u0441\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/p>\n<h6>\u041e\u0431\u0449\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 hotkeys.js<\/h6>\n<pre><code class=\"javascript\">if(!EXT_HOTKEY_JS_INSERTED){ \tvar EXT_HOTKEY_JS_INSERTED = true; \tvar hotkeys = ''; \tvar messages = ''; \tvar timeout = ''; \tchrome.extension.sendRequest({operation: &quot;hotkeys&quot;}, function(response) {\t\/\/\u0437\u0430\u043f\u0440\u043e\u0441 \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0433\u043e\u0440\u044f\u0447\u0438\u0445 \u043a\u043b\u0430\u0432\u0438\u0448 \u0443 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \t\tif (response) \t\tif (response.hotkeys){ \t\t\thotkeys = JSON.parse(response.hotkeys); \t\t\tvar d = document.createElement('DIV'); \/\/\u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0438\u043d\u0434\u0438\u043a\u0430\u0446\u0438\u0438 \u0440\u0435\u0430\u043a\u0446\u0438\u0438 \u043d\u0430 \u0433\u043e\u0440\u044f\u0447\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \t\t\td.id = &quot;hotkeyresponder&quot;; \t\t\t\/\/+\u0441\u0442\u0438\u043b\u0438: \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0432\u0438\u0434, \u0432\u044b\u0441\u043e\u043a\u0438\u0439 z-index \t\t\tdocument.body.appendChild(d); \t\t} \t}); \tdocument.addEventListener('keydown', event_handleKeyDownEvent, true); \/\/\u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430\u0436\u0430\u0442\u0438\u0439 \u043a\u043b\u0430\u0432\u0438\u0448 \u0432 \u043e\u043a\u043d\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \tfunction event_handleKeyDownEvent(e){ \t\tif (!hotkeys) return true; \t\tvar c=0; var a=0; var s=0; \t\tvar k = e.keyCode; \t\tif (e.shiftKey) s = 1; \t\tif (e.altKey) a = 1; \t\tif (e.ctrlKey) c = 1; \t\tif (k==27 && !c && !a && !s){ \t\t\tif (document.getElementById('hotkeyresponder').style.display!='none'){ \t\t\t\t\/\/ \u0441\u043a\u0440\u044b\u0442\u0438\u0435 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u043f\u043e Esc \t\t\t\tdocument.getElementById('hotkeyresponder').style.display=&quot;none&quot;; \t\t\t\te.preventDefault(); e.cancelBubble = true; e.bubbles = false; \t\t\t\treturn false; \t\t\t} \t\t} \t\tfor (var name in hotkeys){ \t\t\tif (hotkeys.hasOwnProperty(name)){ \t\t\t\tif (hotkeys[name].c == c && hotkeys[name].a == a && hotkeys[name].s == s){ \t\t\t\t\t\/\/\u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0430 \u0433\u043e\u0440\u044f\u0447\u0430\u044f \u043a\u043b\u0430\u0432\u0438\u0448\u0430, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \t\t\t\t\tif (name == 'selectProfile' && k &gt; 48 && k &lt; 58 && (c || a || s)){ \t\t\t\t\t\t\/\/\u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0430\u044f \u0433\u043e\u0440\u044f\u0447\u0430\u044f \u043a\u043b\u0430\u0432\u0438\u0448\u0430 &lt;\u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440+\u0446\u0438\u0444\u0440\u0430&gt; \t\t\t\t\t\tchrome.extension.sendRequest({operation: &quot;hotkey&quot;, key:name, id:(k-48)}, function(response) { \t\t\t\t\t\t\tresponseHotkey(name,response.status,response.message); \t\t\t\t\t\t}); \t\t\t\t\t\te.preventDefault(); e.cancelBubble = true; e.bubbles = false; \t\t\t\t\t\treturn false; \t\t\t\t\t} \t\t\t\t\telse if (hotkeys[name].k==k){ \t\t\t\t\t\t\/\/\u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043f\u043e\u043b\u043d\u044b\u043c \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435\u043c. \u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u043e\u0432\u043f\u0430\u043b \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0432\u044b\u0448\u0435, \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \t\t\t\t\t\tif (name=='toggleBodyi'){ \t\t\t\t\t\t\tdocument.getElementById('togglebody').onclick(); \t\t\t\t\t\t} \t\t\t\t\t\t\/\/\u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u0442\u0435\u043b\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (toggle \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 DOM, etc.) \t\t\t\t\t\telse{ \t\t\t\t\t\t\t\/\/\u0433\u043e\u0440\u044f\u0447\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \t\t\t\t\t\t\tchrome.extension.sendRequest({operation: &quot;hotkey&quot;, key:name}, function(response) { \t\t\t\t\t\t\t\tresponseHotkey('pp',response.status,response.message); \t\t\t\t\t\t\t}); \t\t\t\t\t\t} \t\t\t\t\t\te.preventDefault(); e.cancelBubble = true; e.bubbles = false; \t\t\t\t\t\treturn false; \t\t\t\t\t} \t\t\t\t\telse{ \t\t\t\t\t\tcontinue; \t\t\t\t\t} \t\t\t\t} \t\t\t} \t\t} \t} \tfunction responseHotkey(type,status,message){ \t\t\/\/\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0440\u0435\u0430\u043a\u0446\u0438\u0438 \u043d\u0430 \u0433\u043e\u0440\u044f\u0447\u0443\u044e \u043a\u043b\u0430\u0432\u0438\u0448\u0443 \t\tif (status == 'OK' && message){ \t\t\tdocument.getElementById('hotkeyresponder').innerHTML = message; \t\t\tdocument.getElementById('hotkeyresponder').style.display = 'block'; \t\t\tif (timeout) clearTimeout(timeout); \t\t\ttimeout = setTimeout(function(){document.getElementById('hotkeyresponder').style.display='none';},2000); \t\t} \t} } <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u2013 \u0441\u0438\u043d\u0442\u0435\u0437 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0433\u043e\u0440\u044f\u0447\u0438\u0445 \u043a\u043b\u0430\u0432\u0438\u0448 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439. \u042f\u0441\u043d\u043e\u0435 \u0434\u0435\u043b\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0443\u0436\u043d\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043d\u0443\u0436\u0434\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e (\u0431\u0435\u0437 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432), \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0431\u043b\u043e\u043a if, \u0433\u0434\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0432\u0441\u0435 4 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0433\u043e\u0440\u044f\u0447\u0435\u0439 \u043a\u043b\u0430\u0432\u0438\u0448\u0438. \u0415\u0441\u043b\u0438 \u0432 \u0432\u0430\u0448\u0435\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0438 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0432 DOM \u2013 \u044f\u0441\u043d\u043e, \u0447\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0433\u043e\u0440\u044f\u0447\u0435\u0439 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u043d\u0443\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0437\u0434\u043d\u0438\u0442\u044c \u0434\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044e.<\/p>\n<h6>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 background.js<\/h6>\n<pre><code class=\"javascript\">chrome.extension.onRequest.addListener(function(request, sender, sendResponse) { \tloadSettings();\t\/\/\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \tif (request.operation == 'hotkeys'){\t\/\/\u0437\u0430\u043f\u0440\u043e\u0441 \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0433\u043e\u0440\u044f\u0447\u0438\u0445 \u043a\u043b\u0430\u0432\u0438\u0448 \t\tsendResponse({hotkeys:localStorage.hotkeys}); \t} \telse if (request.operation == 'hotkey'){\t\/\/\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0433\u043e\u0440\u044f\u0447\u0435\u0439 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \t\tif (request.key == 'selectProfile'){ \t\t\t\/\/\u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \t\t} \t\t\/\/\u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043b\u0430\u0432\u0438\u0448 \t} \telse{ \t\t\/\/sendResponse({}); \t} }); <\/code><\/pre>\n<p>  <a href=\"http:\/\/stackoverflow.com\/questions\/13709409\/\">\u0413\u043e\u0432\u043e\u0440\u044f\u0442<\/a>, \u0447\u0442\u043e <code>sendRequest<\/code> \u0438 <code>onRequest<\/code> deprecated \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 <code>sendMessage<\/code> \u0441 \u043f\u043e\u0445\u043e\u0436\u0438\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c. \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u043e\u0441\u0442\u0430 \u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b, \u043d\u043e \u043c\u043e\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0431\u0435\u0437 \u0432\u0438\u0434\u0438\u043c\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<\/p>\n<p>  \u0412 \u0442\u0430\u043a\u043e\u043c \u0432\u0438\u0434\u0435 (\u0435\u0441\u043b\u0438 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0432\u0431\u0438\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435) \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/bc0\/542\/22b\/bc054222b91541e6fcb002c25bed5afb.png\" align=\"center\"\/><\/p>\n<p>  \u041e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. \u0417\u0434\u0435\u0441\u044c, \u0432 \u0446\u0435\u043b\u043e\u043c, \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043c\u043d\u043e\u0433\u043e, \u0432\u0441\u0451 \u043d\u0430 \u0432\u0430\u0448\u0435 \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u043a\u043b\u0430\u0432\u0438\u0448 \u043c\u043d\u043e\u0433\u043e, \u0435\u0441\u0442\u044c \u0441\u043c\u044b\u0441\u043b \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u044d\u0442\u043e \u0434\u0435\u043b\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<br \/>  \u041d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u0432 \u0441\u0432\u043e\u0438\u0445 \u0442\u0432\u043e\u0440\u0435\u043d\u0438\u044f\u0445 \u2013 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430.<br \/>  \u0421\u0430\u043c\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435:<\/p>\n<pre><code class=\"javascript\">{ \t... \t&quot;options_page&quot;: &quot;options.html&quot;, \t... } <\/code><\/pre>\n<p>  \u0412 HTML \u043d\u0438\u0447\u0435\u0433\u043e \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u043d\u0435\u0442, \u043f\u0440\u043e\u0441\u0442\u043e placeholder. \u0412\u0441\u0451 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 JavaScript.<br \/>  <i>options.html<\/i><\/p>\n<pre><code class=\"html\">&lt;html&gt; &lt;head&gt; \t&lt;title&gt;Hotkeys&lt;\/title&gt; \t&lt;script type=&quot;text\/javascript&quot; src=&quot;js\/tools.js&quot;&gt;&lt;\/script&gt; \t&lt;script type=&quot;text\/javascript&quot; src=&quot;js\/options.js&quot;&gt;&lt;\/script&gt; &lt;\/head&gt; &lt;body&gt; &lt;!-- \u0432\u0441\u044f\u043a\u0438\u0435 header'\u044b \u0438 \u043f\u0440. --&gt; &lt;div id=&quot;tab1&quot;&gt; \t&lt;p style=&quot;margin-top:0;&quot;&gt;\u0442\u0443\u0442 \u043a\u0430\u043a\u0430\u044f-\u043b\u0438\u0431\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f&lt;\/p&gt; &lt;\/div&gt; &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  <i>options.js<\/i><br \/>  \u041d\u0443\u0436\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u0438\u043c\u0435\u043d\u0430 \u043a\u043b\u0430\u0432\u0438\u0448, \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0433\u043e\u0440\u044f\u0447\u0438\u0445 \u043a\u043b\u0430\u0432\u0438\u0448, \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0438\u043c\u0451\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0439.<\/p>\n<pre><code class=\"javascript\">... var keycodes = ['','','','','','','','','','Tab','','','','Enter','','','','','','','','','','','','','','Escape','','','','','Space','Page Up','Page Down','End','Home','Left','Up','Right','Down','','','','','Insert','Delete','','0','1','2','3','4','5','6','7','8','9','','','','','','','','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','MainM Left','MainM Right','Menu','','','NumPad 0','NumPad 1','NumPad 2','NumPad 3','NumPad 4','NumPad 5','NumPad 6','NumPad 7','NumPad 8','NumPad 9','NumPad *','NumPad +','','NumPad -','NumPad ,','NumPad \/','F1','F2','F3','F4','F5','F6','F7','F8','F9','F10','F11','F12','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','=','','-','','','~','','','','','','','','','','','','','','','','','','','','','','','','','','','','\\\\']; var hotkeys = JSON.parse(localStorage.hotkeys); var phk = ['prevProfile', 'nextProfile', 'selectProfile', 'openOpts', 'toggleHideWidget', 'toggleWidget', 'toggleInCT', 'toggleBody', 'openWidget', 'toggleBodyi', 'actMC', 'actMG'];<\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b: \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 HTML, \u043d\u0430\u0432\u0435\u0448\u0438\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a.<\/p>\n<pre><code class=\"javascript\">initt = function(){ \t... \tfor (var i = 0; i &lt; phk.length;i++){ \t\tvar d = document.createElement('DIV'); \t\td.innerHTML = '&lt;h4 style=&quot;margin:0;&quot;&gt;'+_getMessage(phk[i]+'_title')+'&lt;\/h4&gt;&lt;input type=&quot;checkbox&quot; id=&quot;'+phk[i]+'_c&quot;&gt;&lt;label for=&quot;'+phk[i]+'_c&quot;&gt;Ctrl &lt;b&gt;+&lt;\/b&gt;&lt;\/label&gt;&lt;input type=&quot;checkbox&quot; id=&quot;'+phk[i]+'_a&quot;&gt;&lt;label for=&quot;'+phk[i]+'_a&quot;&gt;Alt &lt;b&gt;+&lt;\/b&gt;&lt;\/label&gt;&lt;input type=&quot;checkbox&quot; id=&quot;'+phk[i]+'_s&quot;&gt;&lt;label for=&quot;'+phk[i]+'_s&quot;&gt;Shift &lt;b&gt;+&lt;\/b&gt;&lt;\/label&gt;'+((phk[i]=='selectProfile')?('&lt;key 1-9&gt;&lt;input type=&quot;hidden&quot; id=&quot;'+phk[i]+'_k&quot; value=&quot;$&quot;&gt; '):('&lt;input type=&quot;text&quot; id=&quot;'+phk[i]+'_k&quot;&gt;'))+'&lt;img src=&quot;img\/delete.gif&quot; style=&quot;height:16px;display:none;&quot; \/&gt;&lt;img src=&quot;img\/ok.png&quot; style=&quot;height:16px;display:none;&quot; \/&gt;&lt;br\/&gt;&lt;span id=&quot;result_'+phk[i]+'&quot; style=&quot;color:red&quot;&gt;&lt;\/span&gt;'; \t\tdocument.getElementById('tab1').appendChild(d); \t} \tdocument.getElementById('tab1').innerHTML+='&lt;button&gt;'+_getMessage('opts_13')+'&lt;\/button&gt;'; \tfor (var i = 0; i &lt; phk.length;i++){ \t\tif (hotkeys[phk[i]]){ \t\t\tdocument.getElementById(phk[i]+'_c').checked = (hotkeys[phk[i]]['c']?true:false); \t\t\tdocument.getElementById(phk[i]+'_a').checked = (hotkeys[phk[i]]['a']?true:false); \t\t\tdocument.getElementById(phk[i]+'_s').checked = (hotkeys[phk[i]]['s']?true:false); \t\t\tif (phk[i]!='selectProfile') \t\t\t\tdocument.getElementById(phk[i]+'_k').value = keycodes[hotkeys[phk[i]]['k']]; \t\t} \t} \t... \tvar m = document.querySelectorAll('input[type=text]') \tfor (var i = 0; i &lt; m.length; i++){ \t\tm[i].addEventListener('keydown',function(event){this.value=(keycodes[event.keyCode]?keycodes[event.keyCode]:'');prevDef(event);return false},false); \t} \t... } <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f. \u0417\u0434\u0435\u0441\u044c \u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u044c \u0438 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u044b. \u041f\u0440\u0438\u0447\u0451\u043c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0435 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0441\u0440\u0430\u0437\u0443 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f, \u0430 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0435 \u043e\u0442\u043c\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<pre><code class=\"javascript\">save = function(){ \tfor (var i = 0; i &lt; phk.length; i++){ \t\tdocument.getElementById('result_'+phk[i]).parentNode.getElementsByTagName('img')[0].style.display = 'none'; \t\tdocument.getElementById('result_'+phk[i]).parentNode.getElementsByTagName('img')[1].style.display = 'none'; \t\tdocument.getElementById('result_'+phk[i]).innerHTML = ''; \t} \tvar hktp = {}; var hkts = {}; \tfor (var i = 0; i &lt; phk.length; i++){ \t\tif ((document.getElementById(phk[i]+'_c').checked || document.getElementById(phk[i]+'_a').checked || document.getElementById(phk[i]+'_s').checked) && document.getElementById(phk[i]+'_k').value){ \t\t\thktp[phk[i]] = { \t\t\t\tc:document.getElementById(phk[i]+'_c').checked, \t\t\t\ta:document.getElementById(phk[i]+'_a').checked, \t\t\t\ts:document.getElementById(phk[i]+'_s').checked, \t\t\t\tk:document.getElementById(phk[i]+'_k').value, \t\t\t}; \t\t} \t\telse{ \t\t\tif (document.getElementById(phk[i]+'_c').checked || document.getElementById(phk[i]+'_a').checked || document.getElementById(phk[i]+'_s').checked || (document.getElementById(phk[i]+'_k').value && document.getElementById(phk[i]+'_k').value!='$')){ \t\t\t\tdocument.getElementById('result_'+phk[i]).innerHTML = _getMessage('opts_12'); \t\t\t\tdocument.getElementById('result_'+phk[i]).parentNode.getElementsByTagName('img')[0].style.display = 'inline'; \t\t\t} \t\t} \t} \tfor (var i = 0; i &lt; phk.length-1; i++){ \t\tfor (var j = i+1; j &lt; phk.length; j++){ \t\t\tif (hktp[phk[i]] && hktp[phk[j]]) \t\t\tif (hktp[phk[i]].c == hktp[phk[j]].c && hktp[phk[i]].a == hktp[phk[j]].a && hktp[phk[i]].s == hktp[phk[j]].s && (hktp[phk[i]].k == hktp[phk[j]].k || ((hktp[phk[i]].k == '$' || hktp[phk[j]].k == '$') && ((hktp[phk[i]].k*1&gt;0 && hktp[phk[i]].k*1&lt;=9) || (hktp[phk[j]].k*1&gt;0 && hktp[phk[j]].k*1&lt;=9))))){ \t\t\t\tdocument.getElementById('result_'+phk[i]).innerHTML = _getMessage('opts_11'); \t\t\t\tdocument.getElementById('result_'+phk[i]).parentNode.getElementsByTagName('img')[0].style.display = 'inline'; \t\t\t\tdocument.getElementById('result_'+phk[j]).innerHTML = _getMessage('opts_11'); \t\t\t\tdocument.getElementById('result_'+phk[j]).parentNode.getElementsByTagName('img')[0].style.display = 'inline'; \t\t\t\thktp[phk[i]] = false; \t\t\t\thktp[phk[j]] = false; \t\t\t} \t\t} \t} \tfor (var name in hktp){ \t\tif (hktp.hasOwnProperty(name) && hktp[name]){ \t\t\tdocument.getElementById('result_'+name).parentNode.getElementsByTagName('img')[1].style.display = 'inline'; \t\t\thkts[name] = { \t\t\t\tc:(document.getElementById(name+'_c').checked?1:0), \t\t\t\ta:(document.getElementById(name+'_a').checked?1:0), \t\t\t\ts:(document.getElementById(name+'_s').checked?1:0), \t\t\t\tk:keycodes.in_array(document.getElementById(name+'_k').value), \t\t\t} \t\t} \t} \tlocalStorage.hotkeys = JSON.stringify(hkts); } <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0430\u0441 \u0441\u043c\u0443\u0449\u0430\u044e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0442\u0438\u043f\u0430 _getMessage \u2013 \u044d\u0442\u043e \u043e\u0431\u0451\u0440\u0442\u043a\u0438 \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 i18n (\u0441\u043c. \u043c\u043e\u0439 <a href=\"http:\/\/habrahabr.ru\/post\/171491\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043f\u043e\u0441\u0442<\/a>)<br \/>  \u0412\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/88b\/145\/4c3\/88b1454c3bb6bde8f96944211053c8a8.png\" align=\"center\"\/><\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0451. \u0418\u0437 \u044d\u0442\u0438\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0432\u043f\u043e\u043b\u043d\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0412 \u0442\u0430\u043a\u043e\u043c \u0432\u0438\u0434\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0433\u043e\u0440\u044f\u0447\u0438\u0445 \u043a\u043b\u0430\u0432\u0438\u0448 \u0441 \u0447\u0435\u0441\u0442\u044c\u044e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0432 \u043c\u043e\u0438\u0445 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u0445, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043d\u0435 \u0436\u0430\u043b\u0443\u044e\u0442\u0441\u044f. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u0447\u0435\u0433\u043e \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u043c\u043d\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2013 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c popup-\u043e\u043a\u043d\u043e. \u042f \u043d\u0435 \u043d\u0430\u0448\u0451\u043b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 API, \u043d\u043e \u0438 \u043c\u043e\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043d\u0435 \u0438\u0437 \u0442\u0435\u0445, \u0433\u0434\u0435 \u043d\u0435\u043f\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043d\u0443\u0436\u043d\u0430 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f \u043a\u043b\u0430\u0432\u0438\u0448 \u043d\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u043e\u043a\u043d\u0430, \u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0439 \u0430\u0440\u0441\u0435\u043d\u0430\u043b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f.    \t \t\t   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/171565\/\"> http:\/\/habrahabr.ru\/post\/171565\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0445\u0430\u0431\u0440\u0430\u0432\u0447\u0430\u043d\u0435.<br \/>  \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e \u0441\u0435\u0440\u0438\u044e \u043f\u043e\u0441\u0442\u043e\u0432 \u0441 \u043b\u0438\u0447\u043d\u044b\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0438 \u0441\u043e\u0432\u0435\u0442\u0430\u043c\u0438 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 Google Chrome.<br \/>  \u0412 \u044d\u0442\u043e\u043c \u0432\u044b\u043f\u0443\u0441\u043a\u0435 \u2013 \u00ab\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435\u00bb \u0433\u043e\u0440\u044f\u0447\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-171565","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/171565","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=171565"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/171565\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=171565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=171565"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=171565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}