Skip to content

Instantly share code, notes, and snippets.

@jrr
Last active May 11, 2020 01:00
Show Gist options
  • Save jrr/b6503e39888f3be4e3c670ac0122c673 to your computer and use it in GitHub Desktop.
Save jrr/b6503e39888f3be4e3c670ac0122c673 to your computer and use it in GitHub Desktop.
Nest Cam Enhancements
// ==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
});
})();
@0xMH
Copy link

0xMH commented Apr 26, 2020

if You're using chrome. Install Tampermonkey extension then copy paste the code into it then viola.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment