Last active
May 11, 2020 01:00
-
-
Save jrr/b6503e39888f3be4e3c670ac0122c673 to your computer and use it in GitHub Desktop.
Nest Cam Enhancements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Nest Cam Smallerizer | |
// @namespace https://github.com/jrr | |
// @version 0.2 | |
// @description make camera more usable in small windows | |
// @author jrr | |
// @match https://home.nest.com/camera/* | |
// @match https://home.nest.com/home/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var observer = new MutationObserver(function(mutations) { | |
var fp = $('.cards object'); | |
if(fp.length === 1 && $('.my-swf-link').length === 0){ | |
console.log('adding button..'); | |
var link_to_swf = fp.attr('data') + '?' + fp.children("[name='flashvars']").attr('value'); | |
var myButton = $('<a class="my-swf-link" href="'+link_to_swf+'" target="_blank">⬈</a>'); | |
myButton.css({ | |
"position": "absolute", | |
"right": "5rem", | |
"color": "white", | |
"top": "1.5rem", | |
"font-size": "1.9rem", | |
"outline": "0" | |
}); | |
myButton.insertAfter( "h1.card-title" ); | |
} | |
if($('.player-footer').length > 0){ | |
console.log("removing footer.."); | |
$('.player-footer').detach(); | |
} | |
}); | |
observer.observe(document.querySelector('#home-container'), { | |
subtree: true, | |
childList: true, | |
attributes: false, | |
characterData: false, | |
attributeOldValue: false, | |
characterDataOldValue: false | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if You're using chrome. Install
Tampermonkey
extension then copy paste the code into it then viola.