We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a0adcec commit 10f54bdCopy full SHA for 10f54bd
src/content-script/update-description-tab.ts
@@ -8,13 +8,13 @@
8
function showExamples() {
9
chrome.storage.local.get(['showExamples'], (result) => {
10
const showExamples = result.showExamples;
11
-
12
- const examples = document.getElementsByClassName('xFUwe')[0];
13
- if (examples && examples.children) {
14
- for (const child of examples.children) {
15
- // skip the first child since it is the title of the examples section
16
- if (child === examples.children[0]) continue;
17
- child.style.display = showExamples ? 'block' : 'none';
+ let examples = document.getElementsByClassName('xFUwe')[0];
+ if (!examples) return;
+ let preTags = examples.getElementsByTagName('pre');
+ if (preTags) {
+ for (let tag of preTags) {
+ console.log(tag);
+ tag.style.display = showExamples ? 'block' : 'none';
18
}
19
20
});
0 commit comments