Skip to content

Commit

Permalink
2.4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperZombi committed May 9, 2023
1 parent b227a48 commit d49eb48
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 9 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Picture-in-Picture-for-Youtube
<img src="https://shields.io/badge/version-v2.4.6-blue">
<img src="https://shields.io/badge/version-v2.4.7-blue">

### Chrome extension

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

## List of changes:

#### 2.4.7:
* `Shorts` Fixed a bug when shortcuts worked if you wrote in the search bar.
* `Shorts` Added a new shortcut on spacebar - Play/Pause (This key is currently assigned by YouTube the following video)

#### 2.4.6:
* Fixed bug with Speedometer not displaying on click

Expand Down
3 changes: 3 additions & 0 deletions chrome/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
"autoplayNext": {
"message": "Autoplay"
},
"play_pause": {
"message": "Play/Pause"
},

"hideSponsor": {
"message": "Hide «Sponsor» button"
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.6",
"version": "2.4.7",
"name": "__MSG_extName__",
"description": "__MSG_extDesc__",
"default_locale": "en",
Expand Down
5 changes: 3 additions & 2 deletions chrome/menu/options.css
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,14 @@ label input{
.keyboard__key {
display: inline-block;
height: 30px;
width: 30px;
min-width: 10px;
padding: 0 10px;
text-align: center;
line-height: 30px;
font-family: sans-serif;
font-size: 18px;
margin: 5px;
border-radius: 5px;
border-radius: 6px;
background: #eee;
filter: drop-shadow(0 2px 2px grey);
transition: 0.2s;
Expand Down
8 changes: 7 additions & 1 deletion chrome/menu/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@
<td><div class="keyboard__key">F</div></td>
<td><span>__MSG_fullscreen__</span></td>
</tr>

<tr>
<td><input class="form-check-input shortcut" type="checkbox" name="play_pause"></td>
<td><div class="keyboard__key">Space</div></td>
<td><span>__MSG_play_pause__</span></td>
</tr>
</table>
</div>

Expand All @@ -171,7 +177,7 @@
</a>

<span style="margin-top:2px;">
<img src="https://shields.io/badge/version-v2.4.6-blue">
<img src="https://shields.io/badge/version-v2.4.7-blue">
<img id="update" style="display:none; margin-left:4px" src="../images/update.svg" height="20px">
</span>
</p>
Expand Down
11 changes: 11 additions & 0 deletions chrome/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,9 @@ function smartVolume(video){
}

var HotKeysWorker = function(e){
let search = document.querySelector("#search-form input")
if (document.activeElement == search){return}

let vid = getShortsCurrent("#shorts-container video");

if (Settings.shortcuts.J_and_L){
Expand All @@ -352,6 +355,9 @@ var HotKeysWorker = function(e){
if (Settings.shortcuts.fullscreen){
fullScreen_button()
}
if (Settings.shortcuts.play_pause){
play_pause_button()
}


function rewind_manager(sec){
Expand Down Expand Up @@ -388,6 +394,11 @@ var HotKeysWorker = function(e){
}
}
}
function play_pause_button(){
if (e.keyCode == 32){
e.preventDefault();
}
}
}


Expand Down
26 changes: 22 additions & 4 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 d49eb48

Please sign in to comment.