Skip to content

Commit

Permalink
Merge pull request #1621 from Nexmo/APIDOC-448_coockies_fix
Browse files Browse the repository at this point in the history
APIDOC-448: FIX Coockies Banner
  • Loading branch information
marcoranieri authored Sep 20, 2022
2 parents 3752e47 + 5900735 commit 795d5bf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions lib/nexmo_developer/app/webpacker/packs/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,20 @@ $(document).ready(function() {
}
}, 8000);
}

// Manually close Coockies banner in Chrome 1 - 79
if (!!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime)) {
setTimeout(function() {
const coockiesBanner = document.querySelector('.optanon-alert-box-wrapper')
if (coockiesBanner) {
if (sessionStorage.getItem('coockiesBanner') === 'clicked') {
coockiesBanner.style.display = 'none'
}
const buttons = coockiesBanner.querySelectorAll('button')
buttons.forEach((button) => {
button.addEventListener('click', () => sessionStorage.setItem('coockiesBanner', 'clicked'))
})
}
}, 100)
}
});
2 changes: 1 addition & 1 deletion lib/nexmo_developer/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module NexmoDeveloper
VERSION = '0.5.8'.freeze
VERSION = '0.5.9'.freeze
end

0 comments on commit 795d5bf

Please sign in to comment.