Merge pull request #15 from nyuszika7h/fix-iframes
Fix for pages that use iframes (and some other minor fixes)
This commit is contained in:
commit
bf2f2685e0
|
@ -166,21 +166,21 @@ function wordToByteArray(wordArray)
|
||||||
// byte array to CryptoJS format
|
// byte array to CryptoJS format
|
||||||
function arrayToWordArray(u8Array)
|
function arrayToWordArray(u8Array)
|
||||||
{
|
{
|
||||||
var words = [], i = 0, len = u8Array.length;
|
var words = [], i = 0, len = u8Array.length;
|
||||||
|
|
||||||
while (i < len) {
|
while (i < len) {
|
||||||
words.push(
|
words.push(
|
||||||
(u8Array[i++] << 24) |
|
(u8Array[i++] << 24) |
|
||||||
(u8Array[i++] << 16) |
|
(u8Array[i++] << 16) |
|
||||||
(u8Array[i++] << 8) |
|
(u8Array[i++] << 8) |
|
||||||
(u8Array[i++])
|
(u8Array[i++])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
sigBytes: len,
|
sigBytes: len,
|
||||||
words: words
|
words: words
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const toHexString = bytes => bytes.reduce((str, byte) => str + byte.toString(16).padStart(2, '0'), '');
|
const toHexString = bytes => bytes.reduce((str, byte) => str + byte.toString(16).padStart(2, '0'), '');
|
||||||
|
|
|
@ -2,9 +2,9 @@ injectScripts();
|
||||||
|
|
||||||
async function injectScripts()
|
async function injectScripts()
|
||||||
{
|
{
|
||||||
await injectScript('lib/pbf.3.0.5.min.js');
|
await injectScript('lib/pbf.3.0.5.min.js');
|
||||||
await injectScript('lib/cryptojs-aes_0.2.0.min.js');
|
await injectScript('lib/cryptojs-aes_0.2.0.min.js');
|
||||||
await injectScript('protobuf-generated/license_protocol.proto.js');
|
await injectScript('protobuf-generated/license_protocol.proto.js');
|
||||||
|
|
||||||
|
|
||||||
await injectScript('content_key_decryption.js');
|
await injectScript('content_key_decryption.js');
|
||||||
|
@ -13,14 +13,14 @@ async function injectScripts()
|
||||||
|
|
||||||
function injectScript(scriptName)
|
function injectScript(scriptName)
|
||||||
{
|
{
|
||||||
return new Promise(function(resolve, reject)
|
return new Promise(function(resolve, reject)
|
||||||
{
|
{
|
||||||
var s = document.createElement('script');
|
var s = document.createElement('script');
|
||||||
s.src = chrome.extension.getURL(scriptName);
|
s.src = chrome.extension.getURL(scriptName);
|
||||||
s.onload = function() {
|
s.onload = function() {
|
||||||
this.parentNode.removeChild(this);
|
this.parentNode.removeChild(this);
|
||||||
resolve(true);
|
resolve(true);
|
||||||
};
|
};
|
||||||
(document.head||document.documentElement).appendChild(s);
|
(document.head||document.documentElement).appendChild(s);
|
||||||
});
|
});
|
||||||
}
|
}
|
|
@ -1,29 +1,29 @@
|
||||||
{
|
{
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "Widivine Decryptor",
|
"name": "Widevine Decryptor",
|
||||||
"short_name": "WidevineDecryptor",
|
"short_name": "WidevineDecryptor",
|
||||||
"description": "Decrypts and logs media keys from websites that use Widivine DRM",
|
"description": "Decrypts and logs media keys from websites that use Widevine DRM",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"permissions":
|
"permissions":
|
||||||
[
|
[
|
||||||
|
|
||||||
],
|
],
|
||||||
"icons":
|
"icons":
|
||||||
{
|
{
|
||||||
|
|
||||||
},
|
},
|
||||||
"browser_action": {
|
"browser_action": {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
"content_scripts":
|
||||||
"content_scripts":
|
[
|
||||||
[
|
{
|
||||||
{
|
"matches": ["https://*/*"],
|
||||||
"matches": ["https://*/*"],
|
"js": ["content_script.js"],
|
||||||
"js": ["content_script.js"],
|
|
||||||
"css": [],
|
"css": [],
|
||||||
"run_at": "document_start"
|
"run_at": "document_start",
|
||||||
}
|
"all_frames": true
|
||||||
],
|
}
|
||||||
"web_accessible_resources": ["content_key_decryption.js", "eme_interception.js", "lib/*", "protobuf-generated/*"]
|
],
|
||||||
|
"web_accessible_resources": ["content_key_decryption.js", "eme_interception.js", "lib/*", "protobuf-generated/*"]
|
||||||
}
|
}
|
Loading…
Reference in New Issue