By the way, you can set up and use a Global script that is accessible from any node (set it up from Project Settings -> Autoload tab), it can also contain a _ready()
function that will run one time once the game is loaded
On a project of mine, I use this function to change between different window modes, maybe one of these could make your think work? Possibly setting the window to fullscreen would work as you intend.
func _on_windowtype_item_selected(index):
match index:
0: #Windowed mode
get_tree().root.mode = Window.MODE_WINDOWED
get_window().size = get_viewport().size #Possibly what you were looking for all this time
## alternatively, get_window().size = DisplayServer.window_get_size() #should make the game window the same size as the whole screen
get_tree().root.borderless = false
1: #Fullscreen mode
get_tree().root.mode = Window.MODE_FULLSCREEN #easiest full screen
2: #Windowed Borderless mode
get_tree().root.mode = Window.MODE_WINDOWED
get_tree().root.borderless = true
3: #Fullscreen Borderless mode
get_tree().root.mode = Window.MODE_MAXIMIZED
get_tree().root.borderless = true
So, kinda like Freenet or I2P?