Skip to content

Commit

Permalink
2.4.9
Browse files Browse the repository at this point in the history
Fixed a bug that plugin dont work
  • Loading branch information
SuperZombi committed Oct 31, 2023
1 parent d467ce6 commit 021c203
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 20 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Picture-in-Picture-for-Youtube

<p align="right">
<img align="left" src="https://shields.io/badge/version-v2.4.8-blue">
<img align="left" src="https://shields.io/badge/version-v2.4.9-blue">
<a href="#donate">💲Support the Project</a>
</p>

Expand Down Expand Up @@ -68,6 +68,9 @@ Activates the Picture-in-Picture button and other useful features.

## List of changes:

#### 2.4.9:
* `Shorts` Fixed a bug that caused the plugin to not work.

#### 2.4.8:
* `Shorts` Fixed a bug when AutoNext not worked.

Expand Down
2 changes: 1 addition & 1 deletion chrome/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"manifest_version": 3,
"version": "2.4.8",
"version": "2.4.9",
"name": "__MSG_extName__",
"description": "__MSG_extDesc__",
"default_locale": "en",
Expand Down
2 changes: 1 addition & 1 deletion chrome/menu/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
</a>

<span style="margin-top:2px;">
<img src="https://shields.io/badge/version-v2.4.7-blue">
<img id="version">
<img id="update" style="display:none; margin-left:4px" src="../images/update.svg" height="20px">
</span>
</p>
Expand Down
11 changes: 9 additions & 2 deletions chrome/menu/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@ if (darkThemeMq.matches) {
else{
theme = "light"
}

chrome.storage.sync.get(null, results => {
const manifestData = chrome.runtime.getManifest();
document.querySelector("#version").src = `https://shields.io/badge/version-${manifestData.version}-blue`

chrome.storage.sync.get({changeIcon: true, animation: "default",
hideSponsor: false, hideButtonLabels: false, hideClips: false, hideDownload: false,
maximumVolume: false, autoNext: false,
speedometer: true, fullscreen: true, showTimeline: false,
shortcuts: {"fullscreen": true, "play_pause": true}
}, results => {
for (let [key, value] of Object.entries(results)) {
if (key == "shortcuts"){
for (let [hotkey, val] of Object.entries(value)) {
Expand Down
13 changes: 5 additions & 8 deletions chrome/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@ var Settings = {}
chrome.storage.sync.get({ changeIcon: true, animation: "default",
hideSponsor: false, hideButtonLabels: false, hideClips: false, hideDownload: false,
maximumVolume: false, autoNext: false,
speedometer: false, fullscreen: false, showTimeline: false,
shortcuts: {} }, results => { Settings = results; });
var fisrt_load = true;
speedometer: true, fullscreen: true, showTimeline: false,
shortcuts: {"fullscreen": true, "play_pause": true}
}, results => { Settings = results; });
window.onload = function() {
main()
}

document.addEventListener("yt-navigate-finish", ()=>{
if (!fisrt_load){
main();
}
fisrt_load = false;
main();
});

document.addEventListener("yt-player-updated", ()=>{
Expand Down Expand Up @@ -126,6 +122,7 @@ function isInViewport(element) {
const height = innerHeight || document.documentElement.clientHeight;
const width = innerWidth || document.documentElement.clientWidth;
return (
!(rect.top == 0 && rect.left == 0 && rect.bottom == 0 && rect.right == 0) &&
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <= height &&
Expand Down
10 changes: 3 additions & 7 deletions pip.user.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 021c203

Please sign in to comment.