How do I access a .xul file using a chrome:// URL? - firefox

I'm learning how to make firefox extensions.
I have created a directory called findfile, under which I have the directories content/ skin/ and locale/ . There is a findfile.xul file in the content/ directory. The other two are empty
I have placed a findfile.manifest file under /home/akshay/.mozilla/firefox/xxxx.dev/chrome/
The content of findfile.manifest is:
content findfile file:///home/akshay/programs/firefox/findfile/content/
skin findfile classic/1.0 file:///home/akshay/programs/firefox/findfile/skin/
locale findfile en-US file:///home/akshay/programs/firefox/findfile/locale/
When I access findfile.xul using a file:// URL, it works fine. But when I try to access it using chrome://findfile/content/findfile.xul, it doesn't show the window. (I restarted the browser)
What am I doing wrong?

Perhaps rename the findfile.manifest to chrome.manifest ?
Also not a good idea to give absolute paths. Use relative paths instead.

Related

My static files are not rending correctly

In my html page I am referencing static assets like:
<script src="/static/assets/js/bundle.js"></script>
and
<link rel="stylesheet" href="/static/assets/css/style.css">
These files are stored in:
/assets/js/bundle.js
/assets/css/style.css
Currently my route looks like this:
app.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("/assets"))))
Currently it is not working and returning a 404 not found error when I look at chrome console.
What am I doing wrong here?
The problem is with your call to http.Dir("/assets") in this line:
app.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("/assets"))))
http.Dir takes the path to the folder either in absolute form or relative to where the go executable is. Using "/assets" tells it that the absolute path to the assets folder is on the root of the file system, where in reality I'm guessing the assets folder is in something like /home/YOUR_USER_FOLDER/code/this_project/assets.
Just change the code to use the absolute path:
app.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("/home/YOUR_USER_FOLDER/code/this_project/assets"))))
If the assets folder is in the same location as the go executable, you can just use "assets" as the file path, but I will recommend using the absolute path to avoid any confusion.

What is the ~ operator used for on a scss file?

I do not understand the meaning of the ~ char in the following line of code in a scss file:
#import "~bootstrap/dist/css/bootstrap.min.css";
Since it's in the file path, I guess it's the "Bootstrap user home directory".
On Linux or Unix, home directories are named ~:
~ : the current user directory (yours)
~juan would be your home directory.
~bootstrap : bootstrap's user directory (ex: /home/bootstrap or maybe /usr/share/bootstrap or /opt/bootstrap)
More examples on https://askubuntu.com/questions/656869/how-does-using-the-tilde-work-as-a-shortcut-to-my-home-directory
So maybe your bootstrap files are located in a particular directory owned by a bootstrap user having that directory as his $HOME directory.
In that case, it's not at all related to Sass, it's only a regular file path.
That is not part of sass, it's actually a feature of sass-loader which you are probably using with webpack.
What it does is importing the file relative to the node_modules folder instead of the current file.
Check out sass-loader's documentation for more details: https://github.com/webpack-contrib/sass-loader#imports.

How to open a pdf file which is in views or controller folder in ci?

i have a pdf file in view folder and controller folder by the link i need to access it how to do this i have tried with following by am getting error like
Access forbidden!
$path=base_url()."application/views/users/sample_pdf_report.pdf";
$path2="C:\xampp\htdocs\vacationgod\application\views\users\sample_pdf_report.pdf"
// OPTIONAL - PUT A LINK TO DOWNLOAD THE PDF YOU JUST CREATED
echo ("<a href='$path2'>Download Your PDF</a>");
i have tried both $path and $path2
You probably have a .htaccess file forbidding people to access files in those folders.
You should create a res folder in your site root path and place your pdf file in that folder and link the file from there..
Happy coding :)

Could not find Maintenance.flag file in root folder magento

I was trying to install an extension in my magento site which was failed in the middle later i could not get access to my admin neither to my site as it shows this error.
http://prntscr.com/68qc3c
this error should be removed maintenance.flag file but this file is not available in my root folder. Please assist me if there is any other way possible?
Thanks
two possible ways are
1 . you can delete manually both session and cache directory from var directory.
path
magento_root/var/
2. or you can delete all files of that extension and reinstall again.
The maintenance.flag file must still be in your root directory, otherwise Magento would not be displaying the 503 error. The way that this is displayed is a result of the index.php file, around line 66:
$maintenanceFile = 'maintenance.flag';
if (file_exists($maintenanceFile)) {
include_once dirname(__FILE__) . '/errors/503.php';
exit;
}
This page cannot even be cached. Re-connect to your FTP server and check for the file in your html directory on the webserver. Alternately, speak with your web hosts & have them remove the file.
As a precaution, you can try deleting your var/cache directory and see if that makes a difference.

Access Forbidden To view image file located in Codeigniter view foldr

I have the following structure,
root folder
--- application
--admin
--controllers
--models
--views
--newsletter
--images
--screenshot.png
--index.php
--- system
---
---
---
as u can see there is a png file inside application/admin/views/newsletter/
when i am using this img src
application/admin/views/newsletter/screenshot.png" />
i see the image as broken link
but when i paste the address of the image in the addess bar of the browser, it says
"Permission Denied"
how can i make the image be seen, without changing the file structure..
That's because any direct access to application folder is blocked by Deny from all rule in application/.htaccess file (by default). If you remove that, it would work.
But, it's better to put all public files out of application folder. You could create a folder like public or assets beside index.php file and put all public files inside that.
And if you're using rewrite rules to remove /index.php/ from URLs, consider adding a condition (as the example below) if you don't want them to be treated by RewriteRule:
RewriteCond $1 !^(index\.php|robots\.txt|favicon\.ico|public)
# Add your files/folders --^
Then the src would be something like: base_url().'public/newsletter/screenshot.png'.

Resources