// weird stuff here to get around a chrome bug with content security policies (CSP)
// see https://stackoverflow.com/questions/24641592/injecting-iframe-into-page-with-restrictive-content-security-policy

export function connectionsRouteViewHandler(connectionsRouteView) {
  let el = connectionsRouteView.getElement();

  // Avoid recursive frame insertion...
  var extensionOrigin = 'chrome-extension://' + chrome.runtime.id;
  if (!location.ancestorOrigins.contains(extensionOrigin)) {
    var iframe = document.createElement('iframe');
    iframe.src = chrome.runtime.getURL('frame-connections.html');
    iframe.style.cssText =
      'position:relative;top:0;left:0;display:block;width:100%;height:100%;z-index:1000;border:0;';
    el.appendChild(iframe);
  }
}

export function createConnectionsNavItem(routeId) {
  return {
    name: 'Spokeo Connections',
    iconUrl: '',
    routeID: routeId
  };
}

@@ -196,16 +196,56 @@
 y-policy
+%0Aimport %7B getAssetUrl %7D from %22../utils%22;
 %0A%0Aexport
@@ -417,17 +417,17 @@
 rigin = 
-'
+%22
 chrome-e
@@ -437,17 +437,17 @@
 nsion://
-'
+%22
  + chrom
@@ -565,16 +565,16 @@
 ent(
-'
+%22
 iframe
-'
+%22
 );%0A 
@@ -611,17 +611,17 @@
 .getURL(
-'
+%22
 frame-co
@@ -634,17 +634,17 @@
 ons.html
-'
+%22
 );%0A    i
@@ -671,17 +671,17 @@
 =%0A      
-'
+%22
 position
@@ -762,17 +762,17 @@
 order:0;
-'
+%22
 ;%0A    el
@@ -877,16 +877,9 @@
 me: 
-'Spokeo 
+%22
 Conn
@@ -885,17 +885,17 @@
 nections
-'
+%22
 ,%0A    ic
@@ -905,10 +905,44 @@
 rl: 
-''
+getAssetUrl(%22assets/Logo-Color.png%22)
 ,%0A  

add icon to connections