Sendkeys to enter fullscreen

I asked bard to help me and this is what it gave

and i inserted this into a template node, and it works!

[{"id":"911e3d0e.7d6e9","type":"ui_template","z":"28a414e3a8847f5a","group":"5a956c96.cfca64","name":"","order":2,"width":0,"height":0,"format":"<script>\nvar elem = document.documentElement;\n// or overwrite value in your callback function ...\n\nthis.scope.action = function toggleFullscreen() {\n  var element = document.body;\n  if (document.fullscreenElement) {\n    document.exitFullscreen();\n  } else {\n    element.requestFullscreen();\n  }\n}\n\n</script>\n<md-button ng-click=\"send({payload:action()})\">\n    Toggle Fullscreen\n</md-button>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","className":"","x":300,"y":180,"wires":[[]]},{"id":"5a956c96.cfca64","type":"ui_group","name":"Saving Data","tab":"f2edd282.5445a","order":3,"disp":true,"width":6,"collapse":false},{"id":"f2edd282.5445a","type":"ui_tab","name":"Node-red: Outliers Removal Dashboard","icon":"dashboard","disabled":false,"hidden":false}]

2 Likes