Skip to content

Commit

Permalink
sendBeacon: x-www-form-urlencoded
Browse files Browse the repository at this point in the history
  • Loading branch information
nicjansma committed Apr 3, 2018
1 parent cd898d2 commit b5d9967
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions boomerang.js
Original file line number Diff line number Diff line change
Expand Up @@ -1836,9 +1836,15 @@ BOOMR_check_doc_domain();
//
// Try the sendBeacon API first
//
if (w && w.navigator && typeof w.navigator.sendBeacon === "function") {
if (w && w.navigator &&
typeof w.navigator.sendBeacon === "function" &&
typeof w.Blob === "function") {
// note we're using sendBeacon with &sb=1
if (w.navigator.sendBeacon(impl.beacon_url, paramsJoined + "&sb=1")) {
var blobData = new w.Blob([paramsJoined + "&sb=1"], {
type: "application/x-www-form-urlencoded"
});

if (w.navigator.sendBeacon(impl.beacon_url, blobData)) {
return true;
}

Expand Down

0 comments on commit b5d9967

Please sign in to comment.