Open a new tab with xpath as search query

I am writing a chrome extension wich adds a context menu that when clicked opens a new google maps tab with a xpath value as search query.

xpath

//*[@id="component-1028"]/b

background.js

/* Create a context-menu */
chrome.contextMenus.create({
id: "GoogleMaps",   // <-- mandatory with event-pages
title: "Open On Google Maps",
contexts: ["all"]
});

/* Register a listener for the `onClicked` event */
chrome.contextMenus.onClicked.addListener(function(info, tab) {
if (tab) {
    /* Inject the code into the current tab */
    /* chrome.tabs.executeScript(tab.id, { code: code }); */
    chrome.tabs.executeScript(tab.id, {file: "content_script.js"});
}
});

content_script.js

window.open("http://maps.google.com/maps?q="+document.evaluate('//*[@id="component-1028"]/b', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.innerHTML;, '_blank');

But the content script doesn't seem to work with the document.evaluate added. But it works fine with something like this:

window.open("http://maps.google.com/maps?q="+, '_blank');

is it possible to add xpath value as a search query?

Thanks.

Google chrome extension to get google MAP contents like route information

how ro create Google chrome extension to get google MAP contents like route information, direction, source, destination from opened google map?

Refused to load the script of Google Maps library inside Chrome extension as external resources due to content security policy

I’m trying to build a Chrome extension that shows simple map. I’ve tried to load the Google Maps API using the attached code inside the content script:

var g = document.createElement('script');
g.src = "https://maps.googleapis.com/maps/api/js?key=MY_KEY&libraries=places";
(document.head || document.documentElement).appendChild(g);

And of course, I’ve changed the content_security_policy to be like this:
"content_security_policy": "script-src 'self' https://maps.googleapis.com https://maps.gstatic.com https://ssl.google-analytics.com https://www.google.com; object-src 'self'"

But I still couldn’t make it work, I still get error message inside the Chrome console:

Refused to load the script
https://maps.googleapis.com/maps-api-v3/api/js/32/2/common.js
because it violates the following Content Security Policy directive:
“script-src https://clients4.google.com/insights/consumersurveys/
https://www.google.com/js/bg/ ‘self’ ‘unsafe-inline’ ‘unsafe-eval’
https://mail.google.com/_/scs/mail-static/
https://hangouts.google.com/ https://talkgadget.google.com/
https://*.talkgadget.google.com/
https://www.googleapis.com/appsmarket/v2/installedApps/
https://www-gm-opensocial.googleusercontent.com/gadgets/js/
https://docs.google.com/static/doclist/client/js/
https://www.google.com/tools/feedback/ https://s.ytimg.com/yts/jsbin/
https://www.youtube.com/iframe_api https://ssl.google-analytics.com/
https://apis.google.com//scs/abc-static/ https://apis.google.com/js/
https://clients1.google.com/complete/
https://apis.google.com//scs/apps-static/_/js/
https://ssl.gstatic.com/inputtools/js/
https://ssl.gstatic.com/cloudsearch/static/o/js/
https://www.gstatic.com/feedback/js/
https://www.gstatic.com/common_sharing/static/client/js/
https://www.gstatic.com/og/_/js/“.

A lot of questions here I’ve seen, but nothing works for me!