Skip to content

Instantly share code, notes, and snippets.

@AdySan
Forked from jrr/smallcam.user.js
Created August 1, 2016 22:53
Show Gist options
  • Save AdySan/0798d3ea427e0b438bdeeeb9ba553842 to your computer and use it in GitHub Desktop.
Save AdySan/0798d3ea427e0b438bdeeeb9ba553842 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
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment