Allow response in webviewclosed event to optionally be URI encoded

This commit is contained in:
Keegan
2016-06-14 22:57:36 -07:00
parent 87807f180c
commit c3c8de77fc
3 changed files with 20 additions and 2 deletions
+2 -1
View File
@@ -162,9 +162,10 @@ Clay.prototype.generateUrl = function() {
Clay.prototype.getSettings = function(response, convert) {
// Decode and parse config data as JSON
var settings = {};
response = response.match(/^\{/) ? response : decodeURIComponent(response);
try {
settings = JSON.parse(decodeURIComponent(response));
settings = JSON.parse(response);
} catch (e) {
throw new Error('The provided response was not valid JSON');
}