I've created a chrome app and opening a new window in background.js using:
chrome.app.window.create
I would like to take a screenshot of the screen, but from what I've read I need to use:
chrome.tabs.captureVisibleTab
but chrome.tabs is undefined
I have permissions:
"tabs",
"activeTab"
How do I take a screenshot?
check the permissions in your Manifest.json file, it should conatins
In chrome extension: use chrome.tabs.captureVisibleTab.For more : captureVisibleTab
tabs and activeTab
"permissions": [
"activeTab",
"tabs",
],
and in chrome apps:: use chrome.desktopCapture. for more: chrome.desktopCapture
"permissions": [
"desktopCapture",
],
Related
When I look at the manifest.js in Chrome DevTools I can see that the logo and colors are there. However, when I start the website from my homescreen on my android device, neither the background or theme color is loaded, nor my splash screen is shown.
Any idea why?
Manifest.json:
{
"short_name": "Example",
"name": "Example",
"icons": [
{
"src": "images/logo_192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "images/logo_512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"start_url": "./",
"display": "standalone",
"theme_color": "#a300c4",
"background_color": "#c46a00"
}
Screenshot:
EDIT
I found the mistake. I was browsing the website via a remote device using the Chrome DevTools. Port-forwarding to localhost:3000 doesn't match the https requirement for the splash screen to get triggered.
Now the pwa starts in standalone mode, the colors and the splash screen are shown correctly.
However, the splash screen logo is not shown and I have no idea why.
The path to the image is correct and the image exists with the correct filename and type.
Any suggestions?
"If you page already has a theme-color meta tag — for example <meta name="theme-color" content="#2196F3"> — then the page level configuration will be used instead of the value in the manifest."
from: https://developers.google.com/web/updates/2015/08/using-manifest-to-set-sitewide-theme-color
Only thing I see wrong with this manifest is start URL. Change it to something like below
"start_url": "/index.html",
or
"start_url": "https://example.com/myapp/",
If this didn't help, please host your app in some public domain and share the URL.
Change the following:
"background_color": "#c46a00" and "background-color": "#ffffff"
The documentation https://code.visualstudio.com/docs/extensionAPI/vscode-api says that icon-name can be taken from the octicon, is it possible to insert icon that is not an octicon?
No, you can't, at least, not yet.
There is an open issue asking to support more icons, but no Milestone defined.
You can add your custom icon.
https://glyphter.com/
add your 5 X 5 svg logo here in section A, then Download the font.
in vscode's package.json
"contributes": {
"icons": {
"custom-icon-id": {
"description": "custom descr",
"default": {
"fontPath": "./customicon.woff", //woff file
"fontCharacter": "\\41" //you added svg logo in section A
}
}}
I want to create a map starting from the basic template but when I open the template in the editor I do not see the map.Even in preview mode the map does not appear
In red is where it should appear the map or am I doing something wrong?
I downloaded json file from mapbox has more than 800 lines of code, it seems that is not empty.
I created a new map from street template and still not showing nothing in edit mode
I would recommend deleting that style and creating a new one based on the style Basic. I just attempted what you described and it works fine.
To create a new Style in Mapbox Studio. You can also follow the Get started with Mapbox Studio docs.
Login into Studio
Home > New Style
Pick a template, I would recommend starting with Streets
To verify, you created a new style based on Basic and not on the Style Empty, correct? The screen capture you have above looks like Empty. You can download your Style to compare.
This is what an Empty style looks like. Empty will have no map, giving you the power to build your own map literally from the ground up.
{
"version": 8,
"name": "Empty",
"metadata": {
"mapbox:autocomposite": true,
"mapbox:type": "template"
},
"sources": {
},
"glyphs": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf",
"layers": [
{
"id": "background",
"type": "background",
"interactive": true,
"paint": {
"background-color": "rgba(0,0,0,0)"
}
}
]
}
I was able to resolve this issue by changing out my video card. (I worked with Mapbox support for a while but they were unable to help.) On a whim I swapped out my BFGE Tech GeForce GTS 250 for a NVIDIA GeForce GTX 670 and it started working.
I suspected a hardware issue as the problem persisted after upgrading to Windows 10.
I added this code to my Add-on SDK extension in the index.js:
var button = ActionButton({
id: "my-button",
label: "my button",
icon: {
"16": "./us16.png",
"32": "./us32.png"
},
onClick: firstClick
});
The Action Button gets added just fine and works, but there is no icon showing. I put the two icon files in the root folder of my add-on. Should I have put them elsewhere?
(Button documentation.)
Yes. Put your icons in data folder, whilst leaving the paths in the code as they are now.
I have same problem. And solution is add this code to packet.json
"permissions": {"private-browsing": true}
see here Firefox SDK Sample Add On Exported XPI Action Button Doesn't Show Up
I just want a simple, light, couple of lines extension that hides the div #appsNav in facebook. As far as I can see #appsNav is holding some useless information for me like games or games feed. Its annoying.
Now I wrote my manifest.json like this:
{
"manifest_version": 2,
"name": "Hide sideNav",
"description": "Hide facebook sideNav.",
"version": "1.0",
"content_scripts": [
{
"matches": ["http://facebook.com/*", "https://facebook.com/*"],
"css": ["mycss.css"],
"js": ["jquery.js", "myscript.js"]
}
],
"permissions": [
"http://facebook.com/*", "https://facebook.com/*"
]
}
My myscript.js like this:
$("#appsNav").hide();
And even a css file to display:none;
#appsNav{
display:none;
}
When I make a dummy page it all works (so I guess the code is written right), but when I try doing it for Facebook, nothing happens. Is there something wrong with my code? Is there is something I am missing?
Every time I change the code (changing the urls from dummy page, to facebook, or some other page), I reload the extension.