It is not impossible to inject javascript that can be run into the products. You can however write an Atlassian Connect add-on that can run javascript inside JIRA / Confluence inside its own iframe: https://connect.atlassian.com
It looks like you're new here. Sign in or register to get started.