Skip to content
Snippets Groups Projects
Commit 7d92c49f authored by Kevin Abel's avatar Kevin Abel
Browse files

Add more origins to ignore for search window messages

Messages posted from the same domain or browser exentions will be
ignored.
parent 926a102c
No related branches found
No related tags found
No related merge requests found
......@@ -259,6 +259,19 @@
googleOrigin = /^https?:\/\/www\.google\.com$/,
isValidOrigin = function(origin) {
if (googleOrigin.test(origin)) {
return false;
}
// don't allow self origin or browser extension origins
if (origin == location.origin || /^chrome:/.test(origin)) {
return false;
}
return true;
},
passiveQuery = function(q, track) {
if (query === q) {
return;
......@@ -330,7 +343,7 @@
$(window).on('message', function(e) {
var oEvent = e.originalEvent, q;
if (googleOrigin.test(oEvent.origin)) {
if (!isValidOrigin(oEvent.origin)) {
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment