core: move centralized custom scripts on top of base.jinja and move getCookie inside

Status Job ID Name Coverage
  Test
passed #1944
black

00:01:58

passed #1943
test

00:11:57

60.0%