How to Start up external url chrome app with fullscreen - google-chrome-app

I'm publishing the chrome app.
I need to open up "http://kangwodnd.cafe24.com/" with fullscreen mode.
in my manifest.json
{
"manifest_version": 2,
"name": "배드민턴 코트 예약시스템",
"description": "Badminton Court Reservation System",
"version": "0.44",
"icons": {
"128": "128.png"
},
"app": {
"background": {
"scripts": ["background.js"]
}
},
"permissions": [
"fullscreen",
"alwaysOnTopWindows"
]
}
and
I don't know what I have to do in background.js
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create("http://kangwodnd.cafe24.com/",{
});
});
It looks like publishing normally, but when I run the app. It's not working no alert no warning.
What am I missing?

You can't open an external URL as a hosted app window.
To achieve what you want, you need to create your own local HTML file, and embed a <webview> into it to show your webapp.

Related

Publishing Actions on google without Dialogflow

I am building a Google Assistant action without using Dialogflow instead using our own NLG / NLU , i am using gactions cli to upload my action file, all works fine , while i am able to test in simulator as well on my phone,
I am unable to submit for Alpha / Beta testing, all i see is those buttons disabled and its saying i do not have any action (as i am not using dialogflow).
How can i submit action for Alpha/Beta testing?
It looks like you haven't defined any actions in the action package (the file you upload using the gactions tool). Unfortunately "action" has several meanings here. One is the app itself, another is the things it can do via 'intents'.
Try adding the main intent to your action package:
{
"actions": [
{
"description": "Default Welcome Intent",
"name": "MAIN",
"fulfillment": {
"conversationName": "HelloWorld"
},
"intent": {
"name": "actions.intent.MAIN",
"trigger": {
"queryPatterns": [
"Open hello world"
]
}
}
}
]
}
The conversationName field must be the same as the one you define under conversations in the same file.
"conversations": {
"HelloWorld": {
"name": "HelloWorld",
"url": "https://myapp.example.com",
"fulfillmentApiVersion": 2,
}
}

Google action console simulator request and response tab not working when using custom action.json

I have the problem that the google home/assitant action console simulators response and request tab are not working. At least when I am using a custom action.json.
For me I am not sure if all have this problem or only some. That are using an custom action sdk. Or is it a problem only because something of my action.json is maybe not 100% correct configured.
here is the action.json:
{
"actions": [
{
"description": "Default Welcome Intent",
"name": "MAIN",
"fulfillment": {
"conversationName": "testApp"
},
"intent": {
"name": "actions.intent.MAIN",
"trigger": {
"queryPatterns": [
"open special manager",
"open s p m"
]
}
}
}
],
"types": [],
"conversations": {
"testApp": {
"name": "testApp",
"url": "https://572e66a2.ngrok.io/",
"fulfillmentApiVersion": 2,
"in_dialog_intents": [
{
"name": "actions.intent.NO_INPUT"
},
{
"name": "actions.intent.SIGN_IN"
}
]
}
}
here is a picture of the request:
As you can see it is only the dummy content in request tab anyway if the chat is working.
The response tab is completly empty. But the messages and voice is correctly working. Also on my google home.
Does anybody have an idea? I will add of course more debug informations if necessary. Can it be trouble with the response or request messages from my server?
But actually the messages, they are working...

How to run chrome extension in specific domain

Is there a way to limit a Chrome extension to only run on certain urls?
I build an extension that I won't to run only inside specific facebook app.
https://apps.facebook.com/appname/*
The extension add option to 'Right click menu' when clicking on image
How can I do that ?
manifest.json
{
"name": "profiler",
"description": "Show user profile page",
"version": "0.2",
"background": {
"scripts": ["dating.js"]
},
"manifest_version": 2,
"icons": {
"16": "icon.png",
"48": "icon.png",
"128": "icon.png"
}
}
Thanks in advance!
To add a menu option that shows only for images on a specific domain you can do the following:
On your manifest:
"permissions": [
"contextMenus"
],
On your background script:
chrome.contextMenus.create( {
title: 'My Menu Item',
contexts: ['image'],
documentUrlPatterns: ['https://apps.facebook.com/appname/*'],
onClick: function( info, tab ) {
...
}
});

Content script doesn't re-execute on page reload

I'm creating a content script Chrome extension that hides the newsfeed on the Facebook homepage.
This script loads when I first open facebook.com, but fails when navigating into Facebook and back to the main page (which is a URL that's defined in the extension correctly).
Here's my manifest.js file:
{
"name": "NewsBlock",
"description": "NewsBlock - Facebook Newsfeed Hider",
"version": "1.0.0",
"background": {
"scripts": ["background.js"]
},
"permissions": [
"tabs", "http://*/*", "https://*/*", "storage"
],
"browser_action": {
"default_title": "NewsBlock",
"default_icon": "icon.png"
},
"content_scripts": [
{
"matches": ["https://www.facebook.com/"],
"js": ["myscript.js"]
}
],
"manifest_version": 2
}
Here's my myscript.js file:
if (document.getElementById('home_stream'))
document.getElementById('home_stream').style.visibility = "hidden";
if (document.getElementById('pagelet_home_stream'))
document.getElementById('pagelet_home_stream').style.visibility = "hidden";
console.log("NewsBlock Activated...")
Any help in understanding why this isn't loaded when I navigate back to the homepage on Facebook will be amazing.
That's because on many occasions the Facebook page uses the history.pushstate method to navigate. This method can change the current url without causing a new page load. The navigation is simulated by replacing part of the page content with the result of ajax calls.
You can use the chrome.webNavigation.onHistoryStateUpdated event to detect that situation, as suggested in this answer https://stackoverflow.com/a/17584559/1507998.
Some links in facebook call ajax functions, so most of time clicking on a link in facebook doesn't change the page, just loads content via ajax. So your content script executes only once.
There are two possible solution,
You can also add a DOM change listener like DOMSubtreeModified, and run the code every time when content is changed.
You can add CSS code to page, so it doesn't need to be run every time even if page is changed via ajax.
Like this,
manifest.json
{
"name": "NewsBlock",
"description": "NewsBlock - Facebook Newsfeed Hider",
"version": "1.0.0",
"background": {
"scripts": ["background.js"]
},
"permissions": [
"tabs", "http://*/*", "https://*/*", "storage"
],
"browser_action": {
"default_title": "NewsBlock",
"default_icon": "icon.png"
},
"content_scripts": [
{
"matches": ["https://www.facebook.com/"],
"js": ["myscript.js"],
"css": ["mystyle.css"]
}
],
"manifest_version": 2
}
mystyle.css
#home_stream, #pagelet_home_stream {
visibility: hidden;
}

google chrome extension perform action on loading pages doesnt work with google and facebook

I am developing a chrome extention that do some action on page load for example alert welcome
I am using Jquery to dect the document.ready it works perfect with all sites but facebook and google I need it works with FB
here is the manifest.json file
{
"name": "Me",
"version": "1.0",
"manifest_version": 2,
"description": "ME",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"permissions": [
"http://api.flickr.com/"
],
"content_scripts": [
{
"matches": ["http://*/*"],
"js": ["jquery.js", "popup.js"]
}
]
}
and here is pop.js
jQuery(document).ready(function () {
console.log("Welcome");
alert("Welcome");
});
and even I don't use Jquery and used the JS method directly still doesnt work
alert("Welcome");
You may have HTTPS enabled on Facebook and Google, your content scripts will run on HTTP sites only.
Change your "matches" field value to "<all_urls>" to include HTTPS sites.