I am trying to use this line of JavaScript as a GreaseMonkey script:
javascript: document.getElementsByClassName("widget-contents")[0].style.height='640px';void(0);
I tried to convert it into a GreaseMonkey script as such:
// ==UserScript==
// @name First GM Script
// @namespace http://www.example.net/
// @description first gm script
// @include https//www.example.net/*
// @version 1
// @grant none
// ==/UserScript==
document.getElementsByClassName('widget-contents') [0].style.height = '640px';
and I am getting this error:
document.getElementsByClassName(...)[0] is undefined
Could someone explain to me what am I doing wrong?