can content script run on https page chrome extensions development - permissions

i am developing a chrome extension, when i run content script on http page, it is ok. But i am confuse why it can't do on https page. Can content script run on https page. And my permissions id like that.
"permissions": [
"http://*/*",
"https://*/*",
"tabs"
],

In addition to including https in the permissions section of your manifest, you also need to include it in the matches section of the content_scripts section:
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js": ["script.js"]
}
]

Content scripts work on https pages. There is probably some other issue.

Related

How to add new API Give web_page to the Chromium project?

I want to add an api similar to chrome.app in chromium
I want this API can be used on all pages
I tried to use this solution to add an 'api', but it can only be used in plug-ins.
How to add new API extension to the Chromium project?
chrome/common/extensions/api/_api_features.json
"testApi":{
"channel": "stable",
"contexts": ["web_page"],
"matches": [
"<all_urls>"
]
}
This api is available on the chrome://setting and webstore pages but not on other pages.
How can I make it work on all pages?

Allowed hosts for serverMiddleware

I have built a NUXT app, and I've added to it a serverMiddleware for handling some REST endpoints and connecting to my database.
serverMiddleware: [
{ path: "/api", handler: "~/api/index.js" },
],
So my question is: How to restrict accessing to /api endpoints from only few hosts ? (like having a list of ALLOWED_ORIGINS)
Setting Access-Control-Allow-Origin in the header solved the issue as explained more in-depth on this answer: https://stackoverflow.com/a/32481816/8816585
Since at the end, this part of Nuxt is a regular Express app.

Firebase hosted site getting error "Did Not Connect: Potential Security Issue" [duplicate]

This question already has an answer here:
Error from Firebase Project URL: Adding www causes "Your connection is not private"
(1 answer)
Closed 2 years ago.
I have added a site to firebase hosting and it is working fine when I navigate to site url without www. in it but when I try to redirect to the site with www. I get HSTS warning.
https://devkey.web.app/ This link is working fine.
https://www.devkey.web.app/ This (with www.) is throwing warning of potential risk.
This is how my firebase.json looks like:
{
"hosting": {
"site": "devkey",
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
I know firebase automaticaly adds HSTS to all its hosted site and that's why I am getting this error but I do not want HSTS if it is not showing the site.
Please let me know how can I access my site at
https://www.devkey.web.app/
I am an Android Developer not a web developer, so I really do not have much idea as what I should do.
https://devkey.web.app/ and https://devkey.firebaseapp.com are the only link for your Firebase Project. Firebase had never been giving www for default link. To use www, you will need to buy a domain and connect it to your Firebase Project. If you need a free domain, you can get it at Freenom https://www.freenom.com/ which provide only five free TLD.

Azure functions proxies setting redirects to backendUri Url

I have azure function app, where I want to use proxy to show static page to the users(which is hosted on another domain) after accessing the function app link like example below
https://myfunctionapp1.azurewebsites.net/
{
"$schema": "http://json.schemastore.org/proxies",
"proxies": {
"default": {
"matchCondition": {
"methods": [
"GET"
],
"route": "/"
},
"backendUri": "https://my-site.azurewebsites.net/default.htm"
}
}
}
The above configuration I have done a year ago showing up the static page on same url, but now when I access the link https://myfunctionapp1.azurewebsites.net/ it is redirecting to https://my-site.azurewebsites.net/default.htm
Is there any new changes to azure function proxy documentation? If so please refer the link here
Thanks & Regards
I encountered a similar issue where the function proxy redirects the browser to the backend URI instead of showing the results from the backend URI on the proxy URL.
It turns out that if the backend URI replies with a 301 or 302 redirect the proxy will return this redirect to the user's browser and therefore the browser will perform a redirect instead of just showing the contents of the backend URI.
In my case this 301 redirect was caused by the backend URI being https://[domain].com which performed a redirect to https://www.[domain].com.
Changing my backend URI to be https://www.[domain].com fixed the issue and it is now working as intended.

Deploy Nuxt on shared hosting

I want to know if it is possible to deploy Nuxt app on a shared hosting.
After running npm run build --spa it generated below file structure in the dist directory, but don't know how to go from here.
nuxt dist
Here are some checklists to deploy your spa app on hosting.
Did you configured your nuxt app as spa? You have to set your nuxt application spa mode in nuxt.config.js.
Reference: https://nuxtjs.org/api/configuration-mode/
Can you configure rewrite rule on your hosting? If you build your application via build --spa you need to configure rewrite rule that rewrite all request into index.html. This is sample configuration on Firebase Hosting.
{
"hosting": {
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
If you can't configure rewrite rule on your hosting, then you can build your application via generate.
Reference: https://nuxtjs.org/api/configuration-generate/
All checklist passed, then just upload your dist directory on your hosting! That's all!
Upload whats inside the build which is dist/ folder to public folder or from where the shared hosting domain points to after generating the pages.
If you're just gonna use it statically I suggest you better use some advanced static pages hosting with many benefits such as free ssl, CDN support, and push to deploy. e.g netlify.com, zeit.co/now .
This would only take you few minutes of learning and huge benefits in a lifetime.