My experimental Chromium extension would like run some content scripts on local HTML pages. I've in my manifest.json file
"permission": [
...
"file:///*/*"
]
and I've checked the "Allow access to file URL's" in the extension management page. However, I'm not seeing the effect. I expected it to add an item to the context menu, but it doesn't in the local page, while it works on web pages. What could be wrong?
Make sure you have set up the "matches" filter correctly in the "content_scripts" section of you manifest.
Related
I made a fully static website using NextJS, exported it and I'm hosting it on S3 using static website hosting. I can click around and successfully view all the pages, including example.com/blog. However if in the browser I click refresh, or enter example.com/blog directly, I get a 404 Not Found error.
When viewing the exported files, I see that /blog/ has no index.html file, even though there should be (in my opinion) since in the original source files I have a /blog/index.ts file, and when in dev mode I can refresh localhost/blog or enter it directly and it works as expected.
In summary, I believe NextJS should create a /blog/index.html file but it doesn't. Is there any way to force this? Am I doing something wrong? Thank you!
To generate an index.html file when exporting to static HTML, enable the trailingSlash setting in your next.config.js:
module.exports = {
trailingSlash: true,
}
./out/blog.html should now become ./out/blog/index.html after the export.
I have configured cognito based authentication and everything is working on my local machine, however when I push the compiled nuxt application to S3, I get the following error after login:
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>YJ5VBAF69BFHNTRA</RequestId>
<HostId>+ROpBRvEbtrVxTgwqSfhDvK5jwhCfbD9eoE3X6RslkFghQXDL+NwkupIqXoYW2Em9ZoBEhP31Oo=</HostId>
</Error>
This seems to be an s3 error, and I am not sure what is causing it as the site acts like normal otherwise.
Can be repeated by registering and trying to login to the site (copyswapper.com).
This is a problem serving the default document (index.html) - instructions on fixing it below.
LOCAL DEVELOPMENT
On your local machine, a development web server, eg the webpack one, serves index.html regardless of the path the user browses to within the vue.js app:
http://localhost:3000/login
AWS
I see you are deploying static files to S3, then serving them via Cloudfront. But the default document handling works differently, meaning this path does not serve an index.html file, and results in an error instead:
https://copyswapper.com/login
AWS PERMISSIONS
I have a demo Single Page App hosted the same way, which you can run from this page to compare against. The standard setup is to only allow Cloudfront to access files, via permissions like this. It results in the above errors if a file is missing though:
{
"Version": "2008-10-17",
"Id": "PolicyForPublicWebsiteContent",
"Statement": [
{
"Sid": "1",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity H1D9C6K7CY211F"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::web.authsamples.com/*"
}
]
}
CONCERN 1: DEFAULT DOCUMENT HANDLING
You need to provide a lambda edge function to serve the default document, regardless of the path of the user within your Single Page App:
Code to set the default document
Here are a couple of paths for my demo SPA. Note that the first of these could be a path within the app, so the default document handling deals with that. The second of these results in a non-existent Javascript file, and I did not try to fix that, so it results in the same error you are getting:
https://web.authsamples.com/nonexistentpath
https://web.authsamples.com/nonexistentpath.js
CONCERN 2: SECURITY HEADERS
While you are there you should also write a lambda edge function to use recommended security headers, similar to this:
Code to set security headers
If you then browse to Mozilla Observatory and type in your site name, you will get a better security rating, as for my demo app:
Demo App Security Rating
LAMBDA EDGE TESTING AND DEPLOYMENT
The lambda edge functions can be managed in a small subproject, as in my example. I use the Serverless framework, meaning the logic is expressed in a Serverless.yml file and I then run these commands during development, to test the logic:
npm install
npm run defaultDocument
npm run securityHeaders
I then deploy the code with these commands:
npm run package
npm run deploy
SUMMARY
Single Page Apps are not 100% static, and require some code to handle the two concerns mentioned above.
I've installed advanced template on my local system but I can't seem to figure out the url, or the url is not working?
Advanced template is installed under advanced directory.
None of following works
http://localhost/yii/advanced/
http://localhost/yii/advanced/web/
http://localhost/yii/advanced/web/index.php
http://localhost/yii/advanced/frontend/web/index.php
What is the url to access website after advanced template is installed? I can see all folders and files under /advanced. Is there any error with installation?
Following is the error I'm getting:
Not Found
The requested URL /web/index.php was not found on this server.
The advance template consist of 3 diff apps frontend, backend and console. Where console is for the Cli and the rest for web, it isnt like basic-app, so you need to access it via http://localhost/yii/advanced/frontend/web/index.php or http://localhost/yii/advanced/backend/web/index.php
I'm going to migrate the site http://www.thetrekkr.com (from a friend) to another server. The current server does have problems, until I migrate the domain I made a subdomain which is http://www.thetrekkr.pd-design.at. Everything works except the themes (Avada) icons - this must be font-awesome-icons. The icons are working in Edge but not in FF, Chrome, Opera.
I tried the following ways to fix the problems:
Change the links in the database to the new subdomain (plugin better search replace)
adding a .htaccess file to load the icons (https://theme-fusion.com/knowledgebase/are-your-font-awesome-icons-or-custom-fonts-not-showing-up/)
adding the following code in the functions.php to load stylesheets or scripts (WordPress site migration - icons missing)
changing many times from www without www etc.
deleting browser cache, trying on more devices
Unfortunately nothing helps.
Update
I notice I am getting these errors in my network tab. Are they a problem?
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://www.thetrekkr.com/wp-content/themes/Avada/includes/lib/assets/fonts/icomoon/icomoon.woff. (Reason: CORS header 'Access-Control-Allow-Origin' missing).
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://www.thetrekkr.com/wp-content/themes/Avada/includes/lib/assets/fonts/icomoon/icomoon.ttf. (Reason: CORS header 'Access-Control-Allow-Origin' missing).
I had the same problem but the solution I found was simple in the end.
Go to theme options -> advanced -> dynamic css/js and then disable file caching, that worked for me. You can also reset the cache on this page.
Thanks
Jamie
I had a similar problem, This is How I fixed missing awesome fonts after migration
I migrated my client's website from MAMP to hostgator using all in one migration but after the migration, all of the avada awesome font wouldn't show (front end and back end) after hours of trying to fix I finally found a solution.
Within the wordpress theme dashboard navigated to > Theme options > Advanced > Theme features > FontAwesome then re-selected every font awesome option then hit save.
I could now select all the font again :)
It looks like you have a hardwired domain in your temporary site. The errors are an attempt to load assets from one site into another, and unless the remote site permits that explicitly, the browser will disallow it for security reasons. As the error indicates, if you wanted this configuration long-term, you can get the remote to allow it using the Access-Control-Allow-Origin header.
However, since this configuration is an accident of using two domains, it would be better to modify your site code to get these fonts to load from a relative path starting from /, rather than referencing the domain explicitly.
Go to Avada > Options > Advanced > Theme Features and check if the Font Awesome v4 Compatibility option is turned On. If not, turn it on and click Save Changes. And If it's already on then turn it off and turn it on again then click save changes.
I'm pretty new in developing for VB.NET. I have a web application and I want to block the access to the files in a directory.
For example:
If the user access the following page: application.com/example/page.aspx
If the user remove the page name and type "application.com/example/", he will see all the files inside the folder "example".
I want to block this possibility and, when a user try to access the files, redirect to an error page.
I know how to solve this in PHP through htaccess, but I have never done it by VB.NET. Any help?
If you are using IIS then
Go to your sites-->Desired Site
From Features Views Select Directory Browsing disabled.
web.config or .htaccess will do.
Remember it is a security risk to have directories open for anyone to see.