Socket
Socket
Sign inDemoInstall

@react-google-maps/api

Package Overview
Dependencies
16
Maintainers
1
Versions
135
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.0-alpha.10 to 1.2.0-alpha.11

3

lib/utils/injectscript.js

@@ -23,3 +23,6 @@ "use strict";

document.head.appendChild(script);
})
.catch(function (err) {
console.error('injectScript error: ', err);
});
};

57

lib/utils/prevent-google-fonts.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var isRobotoStyle = function (element) {
if (element.href &&
element.href.indexOf("https://fonts.googleapis.com/css?family=Roboto") === 0) {
return true;
}
if (element.tagName.toLowerCase() === "style" &&
element.styleSheet &&
element.styleSheet.cssText &&
element.styleSheet.cssText.replace("\r\n", "").indexOf(".gm-style") === 0) {
element.styleSheet.cssText = "";
return true;
}
if (element.tagName.toLowerCase() === "style" &&
element.innerHTML &&
element.innerHTML.replace("\r\n", "").indexOf(".gm-style") === 0) {
element.innerHTML = "";
return true;
}
if (element.tagName.toLowerCase() === "style" &&
!element.styleSheet &&
!element.innerHTML) {
return true;
}
return false;
};
exports.preventGoogleFonts = function () {
var isRobotoStyle = function (element) {
if (element.href &&
element.href.indexOf("https://fonts.googleapis.com/css?family=Roboto") === 0) {
return true;
}
if (element.tagName.toLowerCase() === "style" &&
element.styleSheet &&
element.styleSheet.cssText &&
element.styleSheet.cssText.replace("\r\n", "").indexOf(".gm-style") === 0) {
element.styleSheet.cssText = "";
return true;
}
if (element.tagName.toLowerCase() === "style" &&
element.innerHTML &&
element.innerHTML.replace("\r\n", "").indexOf(".gm-style") === 0) {
element.innerHTML = "";
return true;
}
if (element.tagName.toLowerCase() === "style" &&
!element.styleSheet &&
!element.innerHTML) {
return true;
}
return false;
};
console.log('preventGoogleFonts run');
var head = document.getElementsByTagName("head")[0];
var trueInsertBefore = head.insertBefore.bind(head);
head.insertBefore = function insertBefore(newElement, referenceElement) {
if (!isRobotoStyle(newElement)) {
Reflect.apply(head.insertBefore, head, [newElement, referenceElement]);
Reflect.apply(trueInsertBefore, head, [newElement, referenceElement]);
}
};
var trueAppend = head.appendChild.bind(head);
head.appendChild = function appendChild(textNode) {
if (!isRobotoStyle(textNode)) {
Reflect.apply(head.appendChild, head, [textNode]);
Reflect.apply(trueAppend, head, [textNode]);
}
};
};
{
"name": "@react-google-maps/api",
"version": "1.2.0-alpha.10",
"version": "1.2.0-alpha.11",
"description": "React.js Google Maps API integration",

@@ -5,0 +5,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc