What I'm trying to do is to write some simple html document that would navigate to Conflunce but already logged in. The idea is to generate the Authorization header in this document and to navigate to my Confluence domain (different domain). The full code so far:
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
function myFunction() {
$.ajax({
url: "https://myconfluenceurl",
type: "GET",
crossDomain: true,
dataType: 'jsonp',
beforeSend: function(xhr) {
xhr.setRequestHeader('Authorization', 'Basic djkffwffOnY5MA==');
},
success: function() {
}
});
}
</script>
</head>
<body onload="myFunction()">
</body>
</html>
And I'm getting an error:
Refused to execute script from [myconfluenceurl] because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
Is it even possible what I'm trying to do? Or maybe I should try to do it different way..
I'm completely new to JavaScript so any help would be greatly appreciated.