Anyone knows of a way of getting in runtime the app name, title, description and logo (filename with extension)?
2 Likes
Was searching for the same thing. Somewhere the app knows it because the users service sends confirmation emails with the app name.
I don’t think there is currently a way to get this in a nice way (but I’ll add it internally as a feature request). However, your app’s title, description and logo can be found in the <head>
tag of your app’s HTML, so if you import document
from the JavaScript window at the top of your Form:
from anvil.js.window import document
…you can then access this meta data:
print(document.head.querySelector('[name=title]').content)
print(document.head.querySelector('[name=description]').content)
print(document.head.querySelector('[rel=icon]').href)
5 Likes