{"id":365065,"date":"2024-05-21T02:30:17","date_gmt":"2024-05-21T02:30:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=365065"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=365065","title":{"rendered":"<span>\u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u044d\u043a\u0440\u0430\u043d \u0438 \u0437\u0432\u0443\u043a \u0447\u0435\u0440\u0435\u0437 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 NextCloud<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435 \u0434\u043e\u0440\u043e\u0433\u0438\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438.<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0434\u0435\u043b\u044e\u0441\u044c \u043e\u043f\u044b\u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0434\u043b\u044f Chromium \u0438 Google Chrome \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430.<\/p>\n<p>\u0420\u0430\u043d\u044c\u0448\u0435 \u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u00ab\u0443\u0441\u043b\u043e\u0432\u043d\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u043c\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u043c\u0438 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u043a\u0440\u0438\u043d\u043a\u0430\u0441\u0442\u043e\u0432\u00bb, \u043d\u043e \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0441\u0442\u0430\u043b\u0438 \u043f\u043b\u0430\u0442\u043d\u044b\u043c\u0438, \u0438 \u0438\u0445 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0441\u043e\u0448\u043b\u0438 \u043d\u0430 \u201c\u043d\u0435\u0442\u201d. \u0410 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u0438\u0441\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043a \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441 \u043e\u043f\u043b\u0430\u0442\u043e\u0439. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u044f \u043d\u0435 \u043d\u0430\u0448\u0451\u043b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u0438\u043b\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u0432\u043e\u0451\u043c \u043e\u0431\u043b\u0430\u043a\u0435 \u0438\u043b\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u044b \u0441\u043a\u0430\u0436\u0438\u0442\u0435 &#8212; \u0437\u0430\u0447\u0435\u043c \u043c\u043d\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430?! \u0412\u0435\u0434\u044c \u044f \u043c\u043e\u0433\u0443 \u0432\u0437\u044f\u0442\u044c ffmpeg \u0441 x11grab, \u043f\u0440\u0438\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0432\u0441\u0451 \u044d\u0442\u043e bash-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c curl, \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 \u043e\u0431\u043b\u0430\u043a\u043e \u043e\u0434\u043d\u043e\u0439 \u043b\u0438\u0448\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435! \u0418 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u043d\u044c\u043a\u043e &#171;\u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0443&#187; \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0434 \u0432\u0441\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b! \u0418 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u0440\u0430\u0432\u044b, \u043d\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u043c. \u0410 \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u0442\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0435\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 (\u0434\u0430, \u044d\u0442\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e &#8212; \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 HTML-\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0432\u0430\u0448 \u044d\u043a\u0440\u0430\u043d).<\/p>\n<p>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/77c\/d08\/a0c\/77cd08a0c946857d99f381acd514148a.png\" width=\"1023\" height=\"699\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/77c\/d08\/a0c\/77cd08a0c946857d99f381acd514148a.png\"\/><\/figure>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0430 \u043d\u0430 2 \u0447\u0430\u0441\u0442\u0438: \u043f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a extensions API \u0438 MediaStream API, \u0432\u0442\u043e\u0440\u0430\u044f \u043a \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 Nextcloud.<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0435\u0441\u0442\u044c \u043e\u0442\u0441\u044b\u043b\u043a\u0438 \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0447\u0442\u0435\u043d\u0438\u044f <a href=\"https:\/\/github.com\/njsoftdev\/screencast\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0434\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/a>.<\/p>\n<h3>\u0427\u0430\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u0430\u044f<\/h3>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 \u0441 \u0447\u0435\u0433\u043e \u044f \u043d\u0430\u0447\u0430\u043b: \u043e\u0446\u0435\u043d\u043a\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e-\u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e. \u041b\u043e\u0433\u0438\u0447\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u0439\u0442\u0438 \u0432 <a href=\"https:\/\/developer.chrome.com\/docs\/extensions\/develop\/concepts\/declarepermissions\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043f\u043e extensions API \u0434\u043b\u044f Chrome<\/a> \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0435\u0441\u0442\u044c \u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043f\u0440\u043e \u00abdesktop capture\u00bb \u2014 \u0438 \u0442\u0430\u043a\u043e\u0435 \u0442\u0430\u043c \u0435\u0441\u0442\u044c.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c <a href=\"https:\/\/developer.chrome.com\/docs\/extensions\/reference\/api\/desktopCapture\" rel=\"noopener noreferrer nofollow\">desktopCapture API<\/a> \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0422\u0430\u043c \u0436\u0435 \u0431\u044b\u043b \u043d\u0430\u0439\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0438, \u0441 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435\u043c \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/developer.chrome.com\/docs\/extensions\/how-to\/web-platform\/screen-capture\" rel=\"noopener noreferrer nofollow\">\u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u044d\u043a\u0440\u0430\u043d\u0430<\/a>.<\/p>\n<p>\u0411\u044b\u043b\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u201c\u043a\u043e\u0434 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432\u0438\u0434\u0435\u043e\u043f\u043e\u0442\u043e\u043a\u0430\u201d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0441\u044f \u0432 \u00abbackground\u00bb, \u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 offscreen api \u0438\u043c\u0435\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0438 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d (\u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u044c \u044d\u043a\u0440\u0430\u043d\u0430 \u0441\u043e \u0437\u0432\u0443\u043a\u043e\u043c) . \u0427\u0435\u0440\u0435\u0437 offscreen api \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434: \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0438\u0441\u044c\u044e \u044d\u043a\u0440\u0430\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u043a\u043b\u0430\u0434\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0418 \u044d\u0442\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0438\u0441\u0438, \u043d\u043e \u043d\u0430 \u043d\u0435\u0439 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u043a\u0438. (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u043a\u0443 \u043d\u0430 \u044d\u0442\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0437\u0430\u043f\u0438\u0441\u0438).<\/p>\n<p>\u0418 \u044d\u0442\u043e \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e. \u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u0432\u043a\u043b\u0430\u0434\u043a\u0438 \u0438 \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043d\u0430 \u00ab\u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u00bb, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u0443\u044e \u0432\u043a\u043b\u0430\u0434\u043a\u0443.<\/p>\n<p>\u0424\u0430\u0439\u043b manifest.json<\/p>\n<pre><code class=\"json\">{   \"name\": \"__MSG_extName__\",   \"description\": \"__MSG_extDesc__\",   \"version\": \"1.0\",   \"manifest_version\": 3,   \"default_locale\": \"ru\",   \"icons\": {     \"16\": \"images\/icon-16.png\",     \"32\": \"images\/icon-32.png\",     \"48\": \"images\/icon-48.png\",     \"128\": \"images\/icon-128.png\"   },   \"action\":{     \"16\": \"images\/icon-16.png\",     \"32\": \"images\/icon-32.png\",     \"default_popup\":\"popup.html\"   },   \"background\": {     \"service_worker\": \"background.js\"   },   \"permissions\": [     \"tabs\",     \"activeTab\",     \"desktopCapture\",     \"storage\",     \"unlimitedStorage\"   ],   \"host_permissions\": [     \"*:\/\/*\/*\"   ] }<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c <u>service_worker<\/u> \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u0437\u0430\u043f\u0438\u0441\u0438. \u041c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0442\u043e <strong>background.js<\/strong> \u044d\u0442\u043e \u00ab\u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439\u00bb. \u041e\u043d \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a \u0432\u043a\u043b\u0430\u0434\u043a\u0438 <strong>recorder.html<\/strong> \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 <em>chrome.tabs.sendMessage(tabId) .<\/em><\/p>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 <strong>recorder.html<\/strong> (\u0447\u0435\u0440\u0435\u0437 <strong>recorder.js<\/strong>) \u043c\u044b \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d (\u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u044c \u0441\u043e \u0437\u0432\u0443\u043a\u043e\u043c) \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u044d\u043a\u0440\u0430\u043d \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 (\u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u0440\u0430\u043d\u043e\u0432) \u0438 \u0442\u0430\u043c \u0436\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0442 <strong>background.js<\/strong> \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432 \u043d\u0451\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0438 <strong>popup.html<\/strong> \u0437\u0430\u043f\u0438\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c\u0441\u044f, \u0430 \u0434\u043b\u044f \u0438\u043d\u0434\u0438\u043a\u0430\u0446\u0438\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0443 \u0438 \u0432\u044b\u0432\u043e\u0434 \u0442\u0435\u043a\u0441\u0442\u0430 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438.<\/p>\n<pre><code class=\"javascript\">chrome.action.setBadgeText({text:  chrome.i18n.getMessage('rec')}); chrome.action.setBadgeBackgroundColor({color: '#eb1e3e'}); chrome.action.setTitle({title: chrome.i18n.getMessage('recording')});<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0432\u0438\u0434\u0435\u043e\u0444\u0430\u0439\u043b\u0430, \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0447\u0442\u043e \u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u00ab\u043f\u0440\u043e\u043c\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u00bb. \u0424\u0430\u0439\u043b \u043d\u0435 \u043f\u0440\u043e\u043c\u0430\u0442\u044b\u0432\u0430\u043b\u0441\u044f, \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u043e\u0442\u043a\u0443. \u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435, <a href=\"https:\/\/bugs.chromium.org\/p\/chromium\/issues\/detail?id=642012\" rel=\"noopener noreferrer nofollow\">\u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u0437\u0430\u0434\u0430\u0447\u0443<\/a> \u0432 \u043d\u0435\u0439 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e MediaRecorder \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438 \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u2192 <a href=\"https:\/\/github.com\/w3c\/mediacapture-record\/issues\/119\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/w3c\/mediacapture-record\/issues\/119<\/a> \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a <a href=\"https:\/\/github.com\/w3c\/mediacapture-record\/issues\/119#issuecomment294919124\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044e-\u0440\u0435\u0448\u0435\u043d\u0438\u044e<\/a>  \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/legokichi\/ts-ebml\" rel=\"noopener noreferrer nofollow\">ts-ebml \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<\/a>.<\/p>\n<p>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 ts-ebml? \u042d\u0442\u043e <a href=\"https:\/\/github.com\/node-ebml\/node-ebml\" rel=\"noopener noreferrer nofollow\">\u0444\u043e\u0440\u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043c\u0435\u0434\u0438\u0430-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438 webm \u0438\u043b\u0438 mkv. \u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0438 \u0447\u0438\u0442\u0430\u0442\u044c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u044f \u043d\u0430\u0447\u0430\u043b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439. \u041a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043b \u0435\u0451 \u0438 \u0441\u043e\u0431\u0440\u0430\u043b \u0432 \u0444\u0430\u0439\u043b EBML.js , \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u00ab\u043f\u0440\u043e\u043c\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u0432\u0438\u0434\u0435\u043e\u0444\u0430\u0439\u043b\u00bb (seekable video). \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b <a href=\"https:\/\/github.com\/legokichi\/ts-ebml\/blob\/master\/src\/example_seekable.ts\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u0430<\/a> \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b \u0432\u043d\u0443\u0442\u0440\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f ( \u0431\u0435\u0437 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430)&#8230; \u0418 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e. <\/p>\n<p>\u0424\u0430\u0439\u043b \u043d\u0435 \u043f\u0440\u043e\u043c\u0430\u0442\u044b\u0432\u0430\u043b\u0441\u044f. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u043b\u0438 \u0432 \u00ab\u0434\u0430\u043d\u043d\u044b\u0445\u00bb \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0432\u0438\u0434\u0435\u043e\u0444\u0430\u0439\u043b \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u0433 \u0431\u044b\u0442\u044c \u043d\u0435\u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u043c). \u0412 \u0438\u0442\u043e\u0433\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0440\u0443\u0447\u043d\u043e\u0439 \u0441\u0431\u043e\u0440 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 API EMBL.Reader:<\/p>\n<pre><code class=\"javascript\">mediaRecorder.onstop = async function(e) {     mediaStream.getTracks().forEach(track => track.stop());     const blobFileSource = new Blob(chunks, {type: nextCloud.getVideoMime()});     const webMBuf = await fetch(URL.createObjectURL(blobFileSource)).then(res=> res.arrayBuffer());     const decoder = new EBML.Decoder();     const reader = new EBML.Reader();     reader.drop_default_duration = false;     var last_duration = 0;     \/\/ \u042d\u0442\u043e\u0442 \u0432\u0430\u0436\u043d\u044b\u0439 \u043a\u043e\u0434 \u043e\u0442\u0441\u0443\u0442\u0441\u0432\u0443\u0435\u0442 \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435     reader.addListener(\"duration\", ({timecodeScale, duration})=>{         last_duration += duration;     });      const elms = decoder.decode(webMBuf);     elms.forEach((elm)=>{ reader.read(elm); });     reader.stop();      const refinedMetadataBuf = EBML.tools.makeMetadataSeekable(reader.metadatas, last_duration, reader.cues);     const body = webMBuf.slice(reader.metadataSize);      const blobFile = new Blob([refinedMetadataBuf, body], {type: nextCloud.getVideoMime()});     const url = URL.createObjectURL(blobFile);             \/\/... }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0444\u0430\u0439\u043b \u043f\u0440\u043e\u043c\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432 \u043f\u043b\u0435\u0435\u0440\u0435. \u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043e\u0446\u0435\u043d\u043a\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430. \u0421\u0442\u0430\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e &#8212; \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0432 \u00ab\u043e\u0431\u043b\u0430\u043a\u043e\u00bb (\u043f\u043e\u0434 \u043e\u0431\u043b\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f Nextcloud).<\/p>\n<h3>\u0427\u0430\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u0430\u044f<\/h3>\n<p>\u0414\u043b\u044f \u043e\u0431\u043b\u0430\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e Nextcloud, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438, \u0438 \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0441\u0442\u0430\u043b \u00ab\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b WebDAV\u00bb. \u0423 Nextcloud \u0435\u0441\u0442\u044c <a href=\"https:\/\/docs.nextcloud.com\/server\/28\/developer_manual\/client_apis\/WebDAV\/basic.html\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 WebDAV<\/a>. \u0412 \u044d\u0442\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u043b\u044f Javascript. <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0444\u0430\u0439\u043b\u0430. <a href=\"https:\/\/docs.nextcloud.com\/server\/28\/developer_manual\/client_apis\/WebDAV\/basic.html#uploading-files\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/a> \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u0443\u0442\u044c \u0434\u043e \u043f\u0430\u043f\u043a\u0438 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0438 \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d  \u0440\u0430\u0437\u0434\u0435\u043b \u00ab\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438\u00bb , \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u044b \u043a Nextcloud \u0438 \u043f\u0443\u0442\u044c \u0434\u043b\u044f \u043f\u0430\u043f\u043a\u0438 &#171;\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432&#187;.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bff\/1c1\/750\/bff1c1750ee27f7a0aca285f47ddc6c9.png\" alt=\"\u041f\u0430\u0440\u043e\u043b\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a Nextcloud \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c.\" title=\"\u041f\u0430\u0440\u043e\u043b\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a Nextcloud \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c.\" width=\"648\" height=\"457\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bff\/1c1\/750\/bff1c1750ee27f7a0aca285f47ddc6c9.png\"\/><\/p>\n<div><figcaption>\u041f\u0430\u0440\u043e\u043b\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a Nextcloud \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c.<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0432\u0435\u0441\u0442\u0438 &#171;\u0410\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430&#187; Nextcloud \u0431\u0435\u0437 \u00abtrailing slash\u00bb ( \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 https:\/\/example.ru ), \u0430 \u0432 \u043f\u043e\u043b\u0435 &#171;\u0414\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f&#187; \u043d\u0443\u0436\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u043f\u0443\u0442\u044c \u0434\u043e \u043f\u0430\u043f\u043a\u0438 \u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u0432\u0438\u0434\u0435\u043e\u0444\u0430\u0439\u043b\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u00ab\/screencasts\u00bb.  \u0438\u043b\u0438 \u00ab\/\u00bb. ). \u0414\u0430\u043b\u0435\u0435 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u00ab\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u00bb. \u042d\u0442\u043e\u0442 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 <em>Authorization: Basic base64encode()<\/em> .<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u043e\u0440\u043a \u043d\u0430\u0448\u0435\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u0441\u0432\u043e\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u0442\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b \u00ab\u041d\u0430\u0441\u0442\u0440\u043e\u0435\u043a\u00bb. \u041a\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u044d\u0442\u0443 \u0444\u043e\u0440\u043c\u0443 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u00ab<u>_bindSettingsForm<\/u>\u00bb \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>popup.js<\/strong><\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <strong>chrome.storage.sync<\/strong> , \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u044b, \u0442\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0447\u0435\u0440\u0435\u0437 \u00abfetch api\u00bb \u043a \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0438 \u0432\u0438\u0434\u0435\u043e\u0444\u0430\u0439\u043b \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0432 Nextcloud, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0432\u0438\u0434\u0435\u043e\u043f\u043b\u0435\u0435\u0440 (\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0444\u0430\u0439\u043b\u0430).<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430, \u0442\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u0430 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0430 \u043d\u0430 2 \u044d\u0442\u0430\u043f\u0430: \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u0442\u0430\u043f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 <em>PUT<\/em> \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a <em>webdav<\/em> \u0430\u0434\u0440\u0435\u0441\u0443 \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u0430 (\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 <u>uploadFile<\/u> \u0432 <strong>recorder.js<\/strong>). <\/p>\n<pre><code class=\"javascript\">uploadFile: async function (blob, fileName) {       let url = this.upload_path(fileName);        const totalBytes = blob.size;       let bytesUploaded = 0;        \/\/ \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445       const progressTrackingStream = new TransformStream({           transform(chunk, controller) {               controller.enqueue(chunk);               bytesUploaded += chunk.byteLength;               chrome.runtime.sendMessage({ name: 'nextCloudUploadProgress', data: bytesUploaded \/ totalBytes });           },           flush(controller) {               console.log(\"completed stream\");           },       });       return await fetch(url, {           method: \"PUT\",           headers: {               \"Content-Type\": \"application\/octet-stream\",               \"Authorization\": this.createAuthHeaderValue()           },           body: blob.stream().pipeThrough(progressTrackingStream),           duplex: \"half\",       }); }<\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u0434, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u0430, \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430.<\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u044d\u0442\u0430\u043f &#8212; \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 (\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 <u>fetchVideoPlayerLink<\/u> \u0432 <strong>recorder.js<\/strong>).<\/p>\n<pre><code class=\"javascript\">fetchVideoPlayerLink: async function (fileName) {         const propertyRequestBody = `&lt;?xml version=\"1.0\"?> &lt;d:propfind  xmlns:d=\"DAV:\" xmlns:oc=\"http:\/\/owncloud.org\/ns\" xmlns:nc=\"http:\/\/nextcloud.org\/ns\">   &lt;d:prop>         &lt;oc:fileid \/>         &lt;d:getlastmodified \/>   &lt;\/d:prop> &lt;\/d:propfind>`;          return new Promise((resolve, reject) => {             fetch(this.base_uri(), {                 method: 'PROPFIND',                 headers: {                     \"Accept\": \"text\/plain\",                     \"Depth\": 1,                     \"Content-Type\": \"application\/xml\",                     \"Authorization\": this.createAuthHeaderValue()                 },                 body: propertyRequestBody             }).then((response) => {                 response.text().then(text => {                     if (response.status &lt; 400) {                         const nodes = this.parseWebDavFileListXML(text, nextCloud.base_uri(fileName));                         let lastNode = nodes.pop();                         if(lastNode &amp;&amp; lastNode.hasOwnProperty('fileid'))                         {                             let playerLink = nextCloud.createPlayerLink(lastNode.fileid);                             resolve(playerLink);                         }                         else                         {                             resolve(null);                         }                     } else {                         reject(new Error({ response }), text)                     }                 });             }, (reason => {                 chrome.runtime.sendMessage({ name: 'nextCloudUploadFileError', data: 'fetch_link_error' });                 console.error('fetch_link_error');             }));         });  }<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a: \u043a\u0430\u0436\u0434\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u0430 \u0432\u044b\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0430\u043d\u0435\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u044f \u043d\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0441\u044f (\u0438\u043b\u0438 \u043d\u0435 \u043d\u0430\u0448\u0451\u043b) \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e 1 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441 \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 (<em>\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043b-\u0432\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e \u0434\u0430\u0442\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0444\u0430\u0439\u043b\u0430 \u0432 Nextcloud<\/em>) \u0431\u0443\u0434\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u0435\u043b\u0435\u043d \u0437\u0430 \u0441\u043e\u0432\u0435\u0442. <\/p>\n<h3>\u0412\u044b\u0432\u043e\u0434\u044b<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 Chrome \u0438\u043b\u0438 Chromium (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 119 \u0432\u0435\u0440\u0441\u0438\u0438), \u0442\u043e \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432\u0438\u0434\u0435\u043e \u0441 \u044d\u043a\u0440\u0430\u043d\u0430 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u0432\u0430\u0448 &#171;\u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439&#187; \u0441\u0435\u0440\u0432\u0435\u0440.<\/p>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0438 \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u0412\u0430\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f!<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/785850\/\"> https:\/\/habr.com\/ru\/articles\/785850\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435 \u0434\u043e\u0440\u043e\u0433\u0438\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438.<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0434\u0435\u043b\u044e\u0441\u044c \u043e\u043f\u044b\u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0434\u043b\u044f Chromium \u0438 Google Chrome \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430.<\/p>\n<p>\u0420\u0430\u043d\u044c\u0448\u0435 \u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u00ab\u0443\u0441\u043b\u043e\u0432\u043d\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u043c\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u043c\u0438 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u043a\u0440\u0438\u043d\u043a\u0430\u0441\u0442\u043e\u0432\u00bb, \u043d\u043e \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0441\u0442\u0430\u043b\u0438 \u043f\u043b\u0430\u0442\u043d\u044b\u043c\u0438, \u0438 \u0438\u0445 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0441\u043e\u0448\u043b\u0438 \u043d\u0430 \u201c\u043d\u0435\u0442\u201d. \u0410 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u0438\u0441\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043a \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441 \u043e\u043f\u043b\u0430\u0442\u043e\u0439. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u044f \u043d\u0435 \u043d\u0430\u0448\u0451\u043b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u0438\u043b\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432 \u0441\u0432\u043e\u0451\u043c \u043e\u0431\u043b\u0430\u043a\u0435 \u0438\u043b\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u044b \u0441\u043a\u0430\u0436\u0438\u0442\u0435 &#8212; \u0437\u0430\u0447\u0435\u043c \u043c\u043d\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430?! \u0412\u0435\u0434\u044c \u044f \u043c\u043e\u0433\u0443 \u0432\u0437\u044f\u0442\u044c ffmpeg \u0441 x11grab, \u043f\u0440\u0438\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0432\u0441\u0451 \u044d\u0442\u043e bash-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c curl, \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 \u043e\u0431\u043b\u0430\u043a\u043e \u043e\u0434\u043d\u043e\u0439 \u043b\u0438\u0448\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435! \u0418 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u043d\u044c\u043a\u043e &#171;\u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0443&#187; \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0434 \u0432\u0441\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b! \u0418 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u0440\u0430\u0432\u044b, \u043d\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u043c. \u0410 \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u0442\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0435\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 (\u0434\u0430, \u044d\u0442\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e &#8212; \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 HTML-\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0432\u0430\u0448 \u044d\u043a\u0440\u0430\u043d).<\/p>\n<p>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0430 \u043d\u0430 2 \u0447\u0430\u0441\u0442\u0438: \u043f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a extensions API \u0438 MediaStream API, \u0432\u0442\u043e\u0440\u0430\u044f \u043a \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 Nextcloud.<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0435\u0441\u0442\u044c \u043e\u0442\u0441\u044b\u043b\u043a\u0438 \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0447\u0442\u0435\u043d\u0438\u044f <a href=\"https:\/\/github.com\/njsoftdev\/screencast\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0434\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/a>.<\/p>\n<h3>\u0427\u0430\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u0430\u044f<\/h3>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 \u0441 \u0447\u0435\u0433\u043e \u044f \u043d\u0430\u0447\u0430\u043b: \u043e\u0446\u0435\u043d\u043a\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e-\u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e. \u041b\u043e\u0433\u0438\u0447\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u0439\u0442\u0438 \u0432 <a href=\"https:\/\/developer.chrome.com\/docs\/extensions\/develop\/concepts\/declarepermissions\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043f\u043e extensions API \u0434\u043b\u044f Chrome<\/a> \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0435\u0441\u0442\u044c \u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043f\u0440\u043e \u00abdesktop capture\u00bb \u2014 \u0438 \u0442\u0430\u043a\u043e\u0435 \u0442\u0430\u043c \u0435\u0441\u0442\u044c.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c <a href=\"https:\/\/developer.chrome.com\/docs\/extensions\/reference\/api\/desktopCapture\" rel=\"noopener noreferrer nofollow\">desktopCapture API<\/a> \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0422\u0430\u043c \u0436\u0435 \u0431\u044b\u043b \u043d\u0430\u0439\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0438, \u0441 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435\u043c \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/developer.chrome.com\/docs\/extensions\/how-to\/web-platform\/screen-capture\" rel=\"noopener noreferrer nofollow\">\u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u044d\u043a\u0440\u0430\u043d\u0430<\/a>.<\/p>\n<p>\u0411\u044b\u043b\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u201c\u043a\u043e\u0434 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432\u0438\u0434\u0435\u043e\u043f\u043e\u0442\u043e\u043a\u0430\u201d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0441\u044f \u0432 \u00abbackground\u00bb, \u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 offscreen api \u0438\u043c\u0435\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0438 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d (\u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u044c \u044d\u043a\u0440\u0430\u043d\u0430 \u0441\u043e \u0437\u0432\u0443\u043a\u043e\u043c) . \u0427\u0435\u0440\u0435\u0437 offscreen api \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434: \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0438\u0441\u044c\u044e \u044d\u043a\u0440\u0430\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u043a\u043b\u0430\u0434\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0418 \u044d\u0442\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0438\u0441\u0438, \u043d\u043e \u043d\u0430 \u043d\u0435\u0439 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u043a\u0438. (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u043a\u0443 \u043d\u0430 \u044d\u0442\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0437\u0430\u043f\u0438\u0441\u0438).<\/p>\n<p>\u0418 \u044d\u0442\u043e \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e. \u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u0432\u043a\u043b\u0430\u0434\u043a\u0438 \u0438 \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043d\u0430 \u00ab\u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u00bb, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u0443\u044e \u0432\u043a\u043b\u0430\u0434\u043a\u0443.<\/p>\n<p>\u0424\u0430\u0439\u043b manifest.json<\/p>\n<pre><code class=\"json\">{   \"name\": \"__MSG_extName__\",   \"description\": \"__MSG_extDesc__\",   \"version\": \"1.0\",   \"manifest_version\": 3,   \"default_locale\": \"ru\",   \"icons\": {     \"16\": \"images\/icon-16.png\",     \"32\": \"images\/icon-32.png\",     \"48\": \"images\/icon-48.png\",     \"128\": \"images\/icon-128.png\"   },   \"action\":{     \"16\": \"images\/icon-16.png\",     \"32\": \"images\/icon-32.png\",     \"default_popup\":\"popup.html\"   },   \"background\": {     \"service_worker\": \"background.js\"   },   \"permissions\": [     \"tabs\",     \"activeTab\",     \"desktopCapture\",     \"storage\",     \"unlimitedStorage\"   ],   \"host_permissions\": [     \"*:\/\/*\/*\"   ] }<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c <u>service_worker<\/u> \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u0437\u0430\u043f\u0438\u0441\u0438. \u041c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0442\u043e <strong>background.js<\/strong> \u044d\u0442\u043e \u00ab\u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439\u00bb. \u041e\u043d \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a \u0432\u043a\u043b\u0430\u0434\u043a\u0438 <strong>recorder.html<\/strong> \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 <em>chrome.tabs.sendMessage(tabId) .<\/em><\/p>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 <strong>recorder.html<\/strong> (\u0447\u0435\u0440\u0435\u0437 <strong>recorder.js<\/strong>) \u043c\u044b \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d (\u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u044c \u0441\u043e \u0437\u0432\u0443\u043a\u043e\u043c) \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u044d\u043a\u0440\u0430\u043d \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 (\u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u0440\u0430\u043d\u043e\u0432) \u0438 \u0442\u0430\u043c \u0436\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0442 <strong>background.js<\/strong> \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432 \u043d\u0451\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u0434.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0438 <strong>popup.html<\/strong> \u0437\u0430\u043f\u0438\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c\u0441\u044f, \u0430 \u0434\u043b\u044f \u0438\u043d\u0434\u0438\u043a\u0430\u0446\u0438\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0443 \u0438 \u0432\u044b\u0432\u043e\u0434 \u0442\u0435\u043a\u0441\u0442\u0430 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438.<\/p>\n<pre><code class=\"javascript\">chrome.action.setBadgeText({text:  chrome.i18n.getMessage('rec')}); chrome.action.setBadgeBackgroundColor({color: '#eb1e3e'}); chrome.action.setTitle({title: chrome.i18n.getMessage('recording')});<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0432\u0438\u0434\u0435\u043e\u0444\u0430\u0439\u043b\u0430, \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0447\u0442\u043e \u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u00ab\u043f\u0440\u043e\u043c\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u00bb. \u0424\u0430\u0439\u043b \u043d\u0435 \u043f\u0440\u043e\u043c\u0430\u0442\u044b\u0432\u0430\u043b\u0441\u044f, \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u043e\u0442\u043a\u0443. \u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435, <a href=\"https:\/\/bugs.chromium.org\/p\/chromium\/issues\/detail?id=642012\" rel=\"noopener noreferrer nofollow\">\u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u0437\u0430\u0434\u0430\u0447\u0443<\/a> \u0432 \u043d\u0435\u0439 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e MediaRecorder \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438 \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u2192 <a href=\"https:\/\/github.com\/w3c\/mediacapture-record\/issues\/119\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/w3c\/mediacapture-record\/issues\/119<\/a> \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a <a href=\"https:\/\/github.com\/w3c\/mediacapture-record\/issues\/119#issuecomment294919124\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044e-\u0440\u0435\u0448\u0435\u043d\u0438\u044e<\/a>  \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/legokichi\/ts-ebml\" rel=\"noopener noreferrer nofollow\">ts-ebml \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<\/a>.<\/p>\n<p>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 ts-ebml? \u042d\u0442\u043e <a href=\"https:\/\/github.com\/node-ebml\/node-ebml\" rel=\"noopener noreferrer nofollow\">\u0444\u043e\u0440\u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043c\u0435\u0434\u0438\u0430-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438 webm \u0438\u043b\u0438 mkv. \u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0438 \u0447\u0438\u0442\u0430\u0442\u044c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u044f \u043d\u0430\u0447\u0430\u043b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439. \u041a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043b \u0435\u0451 \u0438 \u0441\u043e\u0431\u0440\u0430\u043b \u0432 \u0444\u0430\u0439\u043b EBML.js , \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u00ab\u043f\u0440\u043e\u043c\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u0432\u0438\u0434\u0435\u043e\u0444\u0430\u0439\u043b\u00bb (seekable video). \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b <a href=\"https:\/\/github.com\/legokichi\/ts-ebml\/blob\/master\/src\/example_seekable.ts\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u0430<\/a> \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b \u0432\u043d\u0443\u0442\u0440\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f ( \u0431\u0435\u0437 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430)&#8230; \u0418 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e. <\/p>\n<p>\u0424\u0430\u0439\u043b \u043d\u0435 \u043f\u0440\u043e\u043c\u0430\u0442\u044b\u0432\u0430\u043b\u0441\u044f. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u043b\u0438 \u0432 \u00ab\u0434\u0430\u043d\u043d\u044b\u0445\u00bb \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0432\u0438\u0434\u0435\u043e\u0444\u0430\u0439\u043b \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u0433 \u0431\u044b\u0442\u044c \u043d\u0435\u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u043c). \u0412 \u0438\u0442\u043e\u0433\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0440\u0443\u0447\u043d\u043e\u0439 \u0441\u0431\u043e\u0440 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 API EMBL.Reader:<\/p>\n<pre><code class=\"javascript\">mediaRecorder.onstop = async function(e) {     mediaStream.getTracks().forEach(track => track.stop());     const blobFileSource = new Blob(chunks, {type: nextCloud.getVideoMime()});     const webMBuf = await fetch(URL.createObjectURL(blobFileSource)).then(res=> res.arrayBuffer());     const decoder = new EBML.Decoder();     const reader = new EBML.Reader();     reader.drop_default_duration = false;     var last_duration = 0;     \/\/ \u042d\u0442\u043e\u0442 \u0432\u0430\u0436\u043d\u044b\u0439 \u043a\u043e\u0434 \u043e\u0442\u0441\u0443\u0442\u0441\u0432\u0443\u0435\u0442 \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435     reader.addListener(\"duration\", ({timecodeScale, duration})=>{         last_duration += duration;     });      const elms = decoder.decode(webMBuf);     elms.forEach((elm)=>{ reader.read(elm); });     reader.stop();      const refinedMetadataBuf = EBML.tools.makeMetadataSeekable(reader.metadatas, last_duration, reader.cues);     const body = webMBuf.slice(reader.metadataSize);      const blobFile = new Blob([refinedMetadataBuf, body], {type: nextCloud.getVideoMime()});     const url = URL.createObjectURL(blobFile);             \/\/... }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0444\u0430\u0439\u043b \u043f\u0440\u043e\u043c\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432 \u043f\u043b\u0435\u0435\u0440\u0435. \u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043e\u0446\u0435\u043d\u043a\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430. \u0421\u0442\u0430\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e &#8212; \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0432 \u00ab\u043e\u0431\u043b\u0430\u043a\u043e\u00bb (\u043f\u043e\u0434 \u043e\u0431\u043b\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f Nextcloud).<\/p>\n<h3>\u0427\u0430\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u0430\u044f<\/h3>\n<p>\u0414\u043b\u044f \u043e\u0431\u043b\u0430\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e Nextcloud, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438, \u0438 \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0441\u0442\u0430\u043b \u00ab\u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b WebDAV\u00bb. \u0423 Nextcloud \u0435\u0441\u0442\u044c <a href=\"https:\/\/docs.nextcloud.com\/server\/28\/developer_manual\/client_apis\/WebDAV\/basic.html\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 WebDAV<\/a>. \u0412 \u044d\u0442\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u043b\u044f Javascript. <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0444\u0430\u0439\u043b\u0430. <a href=\"https:\/\/docs.nextcloud.com\/server\/28\/developer_manual\/client_apis\/WebDAV\/basic.html#uploading-files\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/a> \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u0443\u0442\u044c \u0434\u043e \u043f\u0430\u043f\u043a\u0438 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0438 \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d  \u0440\u0430\u0437\u0434\u0435\u043b \u00ab\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438\u00bb , \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u044b \u043a Nextcloud \u0438 \u043f\u0443\u0442\u044c \u0434\u043b\u044f \u043f\u0430\u043f\u043a\u0438 &#171;\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432&#187;.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u0430\u0440\u043e\u043b\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a Nextcloud \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c.<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0432\u0435\u0441\u0442\u0438 &#171;\u0410\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430&#187; Nextcloud \u0431\u0435\u0437 \u00abtrailing slash\u00bb ( \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 https:\/\/example.ru ), \u0430 \u0432 \u043f\u043e\u043b\u0435 &#171;\u0414\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f&#187; \u043d\u0443\u0436\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u043f\u0443\u0442\u044c \u0434\u043e \u043f\u0430\u043f\u043a\u0438 \u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u0432\u0438\u0434\u0435\u043e\u0444\u0430\u0439\u043b\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u00ab\/screencasts\u00bb.  \u0438\u043b\u0438 \u00ab\/\u00bb. ). \u0414\u0430\u043b\u0435\u0435 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u00ab\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u00bb. \u042d\u0442\u043e\u0442 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 <em>Authorization: Basic base64encode()<\/em> .<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u043e\u0440\u043a \u043d\u0430\u0448\u0435\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u0441\u0432\u043e\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u0442\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b \u00ab\u041d\u0430\u0441\u0442\u0440\u043e\u0435\u043a\u00bb. \u041a\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u044d\u0442\u0443 \u0444\u043e\u0440\u043c\u0443 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u00ab<u>_bindSettingsForm<\/u>\u00bb \u0432 \u0444\u0430\u0439\u043b\u0435 <strong>popup.js<\/strong><\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <strong>chrome.storage.sync<\/strong> , \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u044b, \u0442\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0447\u0435\u0440\u0435\u0437 \u00abfetch api\u00bb \u043a \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0438 \u0432\u0438\u0434\u0435\u043e\u0444\u0430\u0439\u043b \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0432 Nextcloud, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0432\u0438\u0434\u0435\u043e\u043f\u043b\u0435\u0435\u0440 (\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0444\u0430\u0439\u043b\u0430).<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430, \u0442\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u0430 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0430 \u043d\u0430 2 \u044d\u0442\u0430\u043f\u0430: \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u0442\u0430\u043f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 <em>PUT<\/em> \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a <em>webdav<\/em> \u0430\u0434\u0440\u0435\u0441\u0443 \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u0430 (\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 <u>uploadFile<\/u> \u0432 <strong>recorder.js<\/strong>). <\/p>\n<pre><code class=\"javascript\">uploadFile: async function (blob, fileName) {       let url = this.upload_path(fileName);        const totalBytes = blob.size;       let bytesUploaded = 0;        \/\/ \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445       const progressTrackingStream = new TransformStream({           transform(chunk, controller) {               controller.enqueue(chunk);               bytesUploaded += chunk.byteLength;               chrome.runtime.sendMessage({ name: 'nextCloudUploadProgress', data: bytesUploaded \/ totalBytes });           },           flush(controller) {               console.log(\"completed stream\");           },       });       return await fetch(url, {           method: \"PUT\",           headers: {               \"Content-Type\": \"application\/octet-stream\",               \"Authorization\": this.createAuthHeaderValue()           },           body: blob.stream().pipeThrough(progressTrackingStream),           duplex: \"half\",       }); }<\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u0434, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u0430, \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430.<\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u044d\u0442\u0430\u043f &#8212; \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 (\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 <u>fetchVideoPlayerLink<\/u> \u0432 <strong>recorder.js<\/strong>).<\/p>\n<pre><code class=\"javascript\">fetchVideoPlayerLink: async function (fileName) {         const propertyRequestBody = `&lt;?xml version=\"1.0\"?> &lt;d:propfind  xmlns:d=\"DAV:\" xmlns:oc=\"http:\/\/owncloud.org\/ns\" xmlns:nc=\"http:\/\/nextcloud.org\/ns\">   &lt;d:prop>         &lt;oc:fileid \/>         &lt;d:getlastmodified \/>   &lt;\/d:prop> &lt;\/d:propfind>`;          return new Promise((resolve, reject) => {             fetch(this.base_uri(), {                 method: 'PROPFIND',                 headers: {                     \"Accept\": \"text\/plain\",                     \"Depth\": 1,                     \"Content-Type\": \"application\/xml\",                     \"Authorization\": this.createAuthHeaderValue()                 },                 body: propertyRequestBody           <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-365065","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/365065","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=365065"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/365065\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=365065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=365065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=365065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}