There is a site we use that is also a webapp that will work offline as well as online once you open the first time. We currently manually create a desktop shortcut in the chrome browser by bringing up the site, then clicking on the browser menu, go to More Tools, then Create Shortcut. We also check the box for "Open as Window". This then not only puts a shortcut that always opens in Chrome no matter what but also opens it a little cleaner it would appear. When this is done an extension is created on the computer in the Google extensions folder. I'd like to convert this to a Chrome app that can be deployed via group policy but even after going through the developer instructions I can't seem to get it to work.
I've taken the manifest.json that was created when I did it manually and added the missing parameters required of a chrome app, or at least from what I can tell. I've even published the app in the chrome webstore. But it just doesn't seem to work.
The original Manifest.json contains:
{"app": {
"icon_color": "#C02331",
"launch": {
"web_url": "https://www.example.com/RunForm/Login"
},
"linked_icons": [ {
"size": 16,
"url": "https://www.example.com/Content/images/favicon.ico"
}, {
"size": 32,
"url": "https://www.example.com/Content/images/favicon.ico"
}, {
"size": 48,
"url": "https://www.example.com/Content/images/runform/apple-touch-icon-76x76.png"
}, {
"size": 64,
"url": "https://www.example.com/Content/images/runform/apple-touch-icon-76x76.png"
}, {
"size": 76,
"url": "https://www.example.com/Content/images/runform/apple-touch-icon-76x76.png"
}, {
"size": 96,
"url": "https://www.example.com/Content/images/runform/apple-touch-icon-120x120.png"
}, {
"size": 120,
"url": "https://www.example.com/Content/images/runform/apple-touch-icon-120x120.png"
}, {
"size": 128,
"url": "https://www.example.com/Content/images/runform/apple-touch-icon-152x152.png"
}, {
"size": 152,
"url": "https://www.example.com/Content/images/runform/apple-touch-icon-152x152.png"
}, {
"size": 256,
"url": "https://www.example.com/Content/images/runform/apple-touch-icon-152x152.png"
} ]
},
"description": "",
"icons": {
"120": "icons/120.png",
"128": "icons/128.png",
"152": "icons/152.png",
"16": "icons/16.png",
"256": "icons/256.png",
"32": "icons/32.png",
"48": "icons/48.png",
"64": "icons/64.png",
"76": "icons/76.png",
"96": "icons/96.png"
},
"key": "sKDvXmTdpPytbue4P6yYy+6MRc+SMw5PutBMuCo/yLs=",
"name": "Run Form Login",
"version": "2019.5.28.54363"}
And then I added:
"manifest_version": 2,
"name": "Run Form Login",
"description": "RunForm Login Page",
"update_url": "https://clients2.google.com/service/update2/crx",
"permissions": [
"unlimitedStorage",
"notifications"
]
I was expecting that this would then be installed via GPO as an extension like the one I did manually. And then having a desktop shortcut to "C:\Program Files (x86)\Google\Chrome\Application\chrome_proxy.exe" --profile-directory=Default --app-id=[xx_TheAppIdOfTheExtension_xx] would just open then site in the window like it does when we make the link manually. However it just opens Chrome. And it doesn't look like the extension is ending up in the extension folder either even though the information for forced installs is correct in chrome://policy
Related
I've been learning how to make a Chrome extension and have been stuck on just adding an icon for a while now, I've copy pasted code that supposedly works but I keep getting this error:
Could not load icon 'icon16.png' specified in 'icons'.
Could not load manifest.
My code:
{
"manifest_version": 3,
"name": "extension",
"description": "test",
"version": "1.0",
"browser_action": {
"default_icon": "icon48.png"
},
"icons": {
"16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png"
},
"content_scripts": [
{
"js": [
"test.js"
],
"matches": [
"https://www.test.com/*"
]
}
]
}
I've triple checked that every image is in fact a PNG and is of the right size. I have a single directory with manifest.json, test.js, and all three images (as well as a.prettierrc file, although I doubt that has any impact).
If I remove the icons part of manifest.json the extension works perfectly.
The error about not being able to load the manifest is likely related to:
"browser_action": {
"default_icon": "icon48.png"
},
which is from Manifest Version 2. The "browser_action" field should be changed to:
"action": {
"default_icon": "icon48.png"
},
For further reference see here: Action API unification
I use v8-profiler to profile my NodeJS app. It generates a .cpuprofile file.
I used to be able to visualize the content of the file with Google Chrome built-in DevTools. However, Chrome recently changed the file format for profiling results and Chrome is no longer able to read .cpuprofile files.
Note: My goal is to see the call tree and bottom-up. I do not care about flame chart.
Thanks.
I ended up downloading an old Chromium version. http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html?prefix=Win_x64/381909/
There is a vscode extension for viewing .cpuprofile:
Flame Chart Visualizer for JavaScript Profiles
https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-js-profile-flame
Yes, it seems the format has changed. From NodeJS v9.11.1 I'm getting a tree-like JSON structure:
{
"typeId": "CPU",
"uid": "1",
"title": "Profile 1",
"head": {
"functionName": "(root)",
"url": "",
"lineNumber": 0,
"callUID": 1319082045,
"bailoutReason": "no reason",
"id": 17,
"hitCount": 0,
"children": [
{
"functionName": "(anonymous function)",
"url": "...",
"lineNumber": 726,
"callUID": 3193325993,
"bailoutReason": "no reason",
"id": 16,
"hitCount": 0,
"children": [
{
...
From Chromium 66.0.3359.117 I'm getting a flat structure:
{
"nodes": [
{
"id": 1,
"callFrame": {
"functionName": "(root)",
"scriptId": "0",
"url": "",
"lineNumber": -1,
"columnNumber": -1
},
"hitCount": 0,
"children": [
2,
3
]
},
{
...
What worked for me is the chrome2calltree tool, which takes the old format used by NodeJS and turns it into a .prof file that tools like KCacheGrind and QCacheGrind can open.
I have created a Chrome extension and published it to the Chrome Web Store. I noticed with my initial version that when a user tried to install it they would get the warning that my extension could "read and change all your data on the websites you visit". I've changed and republished my extension so that I don't think that warning should be displayed, but it still gets displayed. Based on the information at https://developer.chrome.com/extensions/permission_warnings I don't think that message should be showing up. Below is what is in my manifest.json file. Any suggestions for how to make the warning go away?
{
"name": "Screen Recorder",
"description": "Record a video of your computer screen",
"version": "0.4",
"manifest_version": 2,
"icons": {
"16": "icon.png",
"128": "icon.png"
},
"background": {
"scripts": [
"background.js",
"ourrecorder.js"
]
},
"browser_action": {
"default_icon": "icon.png",
"default_popup": "receiver.html"
},
"permissions": [
"desktopCapture",
"tabCapture",
"notifications",
"unlimitedStorage"
]
}
I already configured my chrome extension to send notification like this:
I have a button that has a event that call createNotification. But the button just send notification if I'm running the extension on apache.
What I'm doing wrong?
Is equal that example http://jsbin.com/ziwod/1/edit?html,js,output
And for me this example just work when I click in "Run with JS".
This is my manifest
{
"name": "EXTENSION EXAMPLE",
"version": "0.0.1",
"manifest_version": 2,
"description" : "This extension is...",
"icons": { "16": "icons/16x16.png", "48": "icons/48x48.png", "128": "icons/128x128.png" },
"omnibox": { "keyword" : "example" },
"browser_action": {
"default_icon": {
"19": "icons/19x19.png",
"38": "icons/38x38.png"
},
"default_title": "Launcher",
"default_popup": "browseraction/popup.html"
},
"background": {
"scripts": ["background.js"],
"persistent": false
},
"permissions" : ["notifications"],
"options_page" : "notification.html",
"chrome_url_overrides" : {
"newtab": "newtab/newtab.html"
},
"devtools_page": "devtools/devtools.html"
}
This is my notification.html http://codepen.io/anon/pen/VYWQwB
From your html file and the manifest file of "manifest_version": 2 is that Content Security Policy is enabled by default. And Chrome developers chose to be strict about it and always disallow inline JavaScript code - only code placed in an external JavaScript file is allowed to execute (to prevent Cross-Site Scripting vulnerabilities in extensions). So <button onclick="notifyMe()"> is not allowed in your html file. onclick attribute is an inline script. You should assign an ID attribute instead: <button id="button">.
Hi I have found other similiar questions on stackoverflow but none of them solved the purpose.
I want my chrome extension/app to be opened in a full tab like how POSTMAN extension is opened.
My manifest.json
{
"name": "Sample App",
"manifest_version": 2,
"version": "0.0.1",
"app": {
"background": {
"scripts": ["main.js"]
}
},
"icons": { "128": "icon.png" },
"permissions" : ["tabs" ]
}
My main.js (alias for background.js)
chrome.app.runtime.onLaunched.addListener(function() {
chrome.tabs.create({'url': chrome.extension.getURL('index.html')}, function(tab) {
alert("Hi");
});
});
index.html is the file i want to load on opening the new tab.
My first time responding here on stackoverflow, please be gentle...
I discovered that it's much easier to add "launch" : { "local_path" : "index.html" } within the manifest.json file. See my sample manifest file below.
{
"manifest_version" : 2,
"name": "Hello World!",
"description": "My first Chrome App.",
"version": "0.1",
"app": {
"launch" : {
"local_path" : "index.html"
}
},
"icons": { "16": "icon.png" }
}
Keep in mind that this example is very basic, it has been stripped of some unnecessary information such as a background script but it should accomplish what you want.
http://developer.chrome.com/apps/first_app.html
chrome.app.runtime.onLaunched is only for Chrome apps, not extensions. The code for your background page will automatically run when the Chrome browser starts, so you can start directly with chrome.tabs.create(...).
Also, you need to include index.html and any resource included in your extension that the page will use in a web_accesible_resources section in your manifest.