-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFullmet.user.js
82 lines (69 loc) · 2.85 KB
/
Fullmet.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// ==UserScript==
// @name Fullmet
// @namespace honami
// @version 0.06
// @description Enables HTML5 video controls on Google Meet's in-meeting video presentation.
// @author lee.wp14
// @source https://github.com/leewp14/Fullmet
// @updateURL https://github.com/leewp14/Fullmet/raw/main/Fullmet.user.js
// @supportURL https://github.com/leewp14/Fullmet/issues
// @match https://meet.google.com/*
// @grant none
// @runat document-body
// @noframes
// ==/UserScript==
(function() {
'use strict';
// global variables
var honami_FullmetNode = null;
var honami_FullmetInlineStyle = '';
honami_FullmetInlineStyle += "video{pointer-events: initial !important;}"; // video
honami_FullmetInlineStyle += ".uAzxg{pointer-events: none;} .uAzxg div{pointer-events: all;}"; // participant tooltip
var honami_FullmetClassDelay = 2000;
// internal variables
var honamiInternals_debug_enabled = false;
var honamiInternals_debug_label = '[DEBUG] leewp14/Fullmet';
honamiInternals_debug('script started');
honami_init();
honami_injectStyle();
setInterval(honami_videoNode_injectClass, honami_FullmetClassDelay);
honamiInternals_debug('script ended');
// functions
function honami_init(){
// create style element
honamiInternals_debug('exec honami_init()');
honami_FullmetNode = document.createElement('style');
honami_FullmetNode.id = 'honami_FullmetNode';
honami_FullmetNode.innerHTML = honami_FullmetInlineStyle;
honamiInternals_debug('exit honami_init()');
}
function honami_injectStyle(){
// inject style element
honamiInternals_debug('exec honami_injectStyle()');
if(honami_FullmetNode && document.body){
document.body.appendChild(honami_FullmetNode);
}
honamiInternals_debug('exit honami_injectStyle()');
}
function honami_videoNode_injectClass(){
// set 'controls' attribude to video elements
honamiInternals_debug('exec honami_videoNode_injectClass()');
var videoNode = document.getElementsByTagName('video');
if(videoNode){
for(var i = 0; i < videoNode.length; i++){
var videoNodePointer = videoNode[i];
if(!videoNodePointer.hasAttribute('controls')){
videoNodePointer.setAttribute('controls', '');
}
};
}
honamiInternals_debug('exit honami_videoNode_injectClass()');
}
// internal functions
function honamiInternals_debug(type){
// log debugging messages
if(honamiInternals_debug_enabled){
console.log(honamiInternals_debug_label + ': ' + type ?? 'undefined action');
}
}
})();