-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e90c3c6
commit 5fcb4df
Showing
12 changed files
with
181 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import Alerts from './utils/alerts'; | ||
|
||
const fn = function () { | ||
const alerts = new Alerts('#alerts'); | ||
/* global chrome */ | ||
chrome.storage.local.get('profilerStats', (stats) => { | ||
if (chrome.runtime.lastError) { | ||
alerts.failure('Can not get data: ' + chrome.runtime.lastError.message); | ||
return; | ||
} | ||
|
||
const statsContainer = document.getElementById("profilerStats"); | ||
let pre = statsContainer.querySelector('pre'); | ||
if (pre) { | ||
pre.remove(); | ||
} | ||
pre = document.createElement("pre"); | ||
const code = document.createElement("code"); | ||
code.classList.add('language-json'); | ||
code.innerText = JSON.stringify(stats.profilerStats, null, 2); | ||
pre.appendChild(code); | ||
statsContainer.appendChild(pre); | ||
/* global hljs */ | ||
hljs.configure({ | ||
tabReplace: ' ', | ||
}); | ||
hljs.highlightBlock(code); | ||
}); | ||
}; | ||
|
||
if (["complete", "interactive"].indexOf(document.readyState) > -1) { | ||
fn(); | ||
} | ||
else { | ||
document.addEventListener("DOMContentLoaded", fn); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>DOU enhancer - profiling data</title> | ||
<link rel="stylesheet" href="vendor/highlightjs/styles/monokai.css"> | ||
</head> | ||
<body> | ||
<div id="alerts"></div> | ||
<div id="profilerStats"></div> | ||
<script type="text/javascript" src="vendor/highlightjs/highlight.pack.js"></script> | ||
<script type="text/javascript" src="js/profiling.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import profiler from '../utils/profiler'; | ||
|
||
/** | ||
* Expands all threads by "clicking" on each expand link | ||
*/ | ||
const expandThreads = function () { | ||
profiler.start('expandThreads'); | ||
document.querySelectorAll('.expand-thread').forEach(thread => { | ||
thread.click(); | ||
}); | ||
profiler.stop('expandThreads'); | ||
}; | ||
|
||
export default expandThreads; |