The HOME or COMPOSER_HOME environment variable must be set for composer to run correctly
# Composer install
COMPOSER_HOME="/usr/local/bin/composer" php /usr/local/bin/composer install --working-dir=/var/www/sites/$SITE_NAME 2>&1 || true
Как отправить объект из фоновой страницы на расширение Google?
{
"name": "App",
"description": "Desc",
"version": "1.1",
"icons": {
"16": "icon-16.png",
"128": "icon-128.png"
},
"browser_action": {
"default_icon": "icon-16.png",
"default_popup": "popup/popup.html"
},
"background": {
"scripts": [
"js/listener.js"
"js/background.js",
]
},
"externally_connectable": {
"matches": [
"*://*.site.com/*",
]
},
"manifest_version": 2,
"minimum_chrome_version": "35",
"permissions": [
"webNavigation",
"notifications",
"tabs",
]
}
chrome.runtime.onMessageExternal.addListener(function (message, sender, sendResponse) {
console.log(message);
console.log(message.type);
if(message.type == 'checkBrowserAppInstalled'){
sendResponse({
installed: true
})
}
return true;
});
var BROWSERAPPID = 'ID OF APP';
var OBJECT_TO_SEND = {type: "checkBrowserAppInstalled", data : [1,2,3]};
var checkApp = function () {
return new Promise(function (resolve, reject) {
chrome.runtime.sendMessage(BROWSERAPPID, OBJECT_TO_SEND , null, function (response) {
if (response && response.installed === true) {
resolve(response);
} else {
reject({reason: "APP_NOT_FOUND"})
}
});
});
}
checkApp().then(function(){
...
});
module.exports = {
context: __dirname + '/frontend',
entry: {
home: './home',
about: './about'
//header: './header'
},
var path = require("path");
module.exports = {
//context: path.resolve(__dirname, "frontend") ,
entry: {
home: path.resolve(__dirname, "frontend",'home'),
about: path.resolve(__dirname, "frontend",'about')
//header: './header'
},
....
var token = '<ACCESS_TOKEN>';
var getVideos = function(){
var params = {
extended: 1,
v: 5.45,
access_token: token,
videos: ['12312332_3232323,33242424244_5141424']
callback: "JSON_CALLBACK",
};
return $http.jsonp('https://api.vk.com/method/video.get', {
params: params
});
}
//Run
getVideos().then(function(videoResponse){
//Here video response
console.log(videoResponse):
});