I am encountering a similar issue with AngularJS regarding the use of OneDrive file picker in a browser. More details can be found here.
I have inserted the following code into my index.html page:
<script type="text/javascript" src="//js.live.net/v5.0/wl.js"></script>
. However, it does not seem to be functioning as expected. Any suggestions on how to resolve this?
Update 1: This is an excerpt from my source code:
WL.init({ client_id: clientId, redirect_uri: redirectUri });
WL.login({ "scope": "wl.skydrive wl.signin" }).then(
function(response) {
openFromSkyDrive();
},
function(response) {
log("Failed to authenticate.");
}
);
function openFromSkyDrive() {
WL.fileDialog({
mode: 'open',
select: 'single'
}).then(
function(response) {
log("The following file is being downloaded:");
log("");
var files = response.data.files;
for (var i = 0; i < files.length; i++) {
var file = files[i];
log(file.name);
WL.download({ "path": file.id + "/content" });
}
},
function(errorResponse) {
log("WL.fileDialog errorResponse = " + JSON.stringify(errorResponse));
}
);
}
function log(message) {
var child = document.createTextNode(message);
var parent = document.getElementById('JsOutputDiv') || document.body;
parent.appendChild(child);
parent.appendChild(document.createElement("br"));
}
When I click on the button, a popup appears prompting me to login to OneDrive. After entering my username and password, the popup remains on the redirectURI without displaying the file picker.
Apologies for any confusion caused by my initial question.