Skip to content

Commit

Permalink
Merge branch 'release-0.9.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
puddingspudding committed Jan 30, 2019
2 parents 47d9722 + e3b8252 commit 50d1cfb
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 20 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@

## Dependencies

### [Material Components Web](https://github.com/material-components/material-components-web)
### [Material Components Web 0.41.0](https://github.com/material-components/material-components-web/archive/v0.41.1.zip)

```
git submodule init && git submodule update
cd material-components-web && npx webpack
$ unzip v0.41.1.zip
$ cd v0.41.1.zip
$ npm install
$ npx webpack
```

## Zip Extension
Expand All @@ -37,11 +39,11 @@ zip package.zip \
LICENSE \
icon*.png \
contentscript.js \
material-components-web/build/material-components-web.css \
material-components-web/build/mdc.ripple.css \
material-components-web/build/mdc.autoinit.js \
material-components-web/build/material-components-web.js \
material-components-web/build/mdc.ripple.js
material-components-web-0.41.1/build/material-components-web.css \
material-components-web-0.41.1/build/mdc.ripple.css \
material-components-web-0.41.1/build/mdc.autoinit.js \
material-components-web-0.41.1/build/material-components-web.js \
material-components-web-0.41.1/build/mdc.ripple.js
```

17 changes: 14 additions & 3 deletions contentscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,20 @@
let websiteKey = STORAGE_KEY + '_' + host;
store.local.get([key, MAX_VOL_STORAGE_KEY, websiteKey, STORAGE_KEY], function(data) {

var videoTags = document.getElementsByTagName("video");
var audioTags = document.getElementsByTagName("audio");

var videoTags = Array.from(document.getElementsByTagName("video"));
var audioTags = Array.from(document.getElementsByTagName("audio"));

var iframes = document.getElementsByTagName('iframe')
if (iframes.length) {
for (var x = 0; x < iframes.length; x++) {
var iframe = iframes[x];
if (iframe.contentDocument) {
videoTags = videoTags.concat(Array.from(iframe.contentDocument.getElementsByTagName('video')))
audioTags = audioTags.concat(Array.from(iframe.contentDocument.getElementsByTagName('audio')))
}
}
}

if (videoTags.length == 0 && audioTags.length == 0) {
return;
}
Expand Down
8 changes: 4 additions & 4 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "Persistent Video/Audio Volume",
"version" : "0.8.1",
"version" : "0.9.1",
"manifest_version" : 2,
"description" : "Saves video and audio volume",
"permissions": ["storage", "tabs", "<all_urls>"],
Expand All @@ -10,9 +10,9 @@
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"css": [],
"js": ["contentscript.js"]
"matches": ["<all_urls>"],
"css": [],
"js": ["contentscript.js"]
}
],
"browser_action": {
Expand Down
10 changes: 5 additions & 5 deletions popup.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="material-components-web/build/material-components-web.css">
<link rel="stylesheet" href="material-components-web/build/mdc.ripple.css">
<link rel="stylesheet" href="material-components-web-0.41.1/build/material-components-web.css">
<link rel="stylesheet" href="material-components-web-0.41.1/build/mdc.ripple.css">
<style type="text/css">
html, body {
width: 300px;
Expand Down Expand Up @@ -70,9 +70,9 @@
</div>
</div>

<script src="material-components-web/build/mdc.autoinit.js"></script>
<script src="material-components-web/build/material-components-web.js"></script>
<script src="material-components-web/build/mdc.ripple.js"></script>
<script src="material-components-web-0.41.1/build/mdc.autoinit.js"></script>
<script src="material-components-web-0.41.1/build/material-components-web.js"></script>
<script src="material-components-web-0.41.1/build/mdc.ripple.js"></script>
<script src="popup.js"></script>

</body>
Expand Down

0 comments on commit 50d1cfb

Please sign in to comment.