I always want to see the expanded section when searching for a definition, so I would like it to automatically expand upon loading the page.
Using Tampermonkey to create a userscript that applies to google.com/search?q=meaning+*
From inspecting page elements I have found line
<div class="S8ee5 CwbYXd wHYlTd vk_arc" aria-controls="tsuid_46" aria-expanded="false" data-fbevent="fastbutton" role="button" tabindex="0">
"aria-expanded" changes value when clicking on the button.
Class "S8ee5 CwbYXd wHYlTd vk_arc" has spaces in it, which apparently means multiple classes, so should setAttribute() access by index?
I added window.onload to try to make it run after the page has finished loading in case it tries to access elements prematurely.
My ineffective attempt:
(window.onload = function() {
'use strict';
document.getElementsByClassName("S8ee5 CwbYXd wHYlTd vk_arc")[0].setAttribute("aria-expanded", "true");
})();