საიტის გასაუმჯობესებელი სამუშაოების მიმდინარეობისას, შესაძლებლობების ნაწილი შეიზღუდება. თუ სტატიით ვერ მოახერხებ ხარვეზის გამოსწორება და შეკითხვის დასმა გსურთ, ჩვენი მხარდაჭერის გუნდი დაგეხმარებათ @FirefoxSupport გვერდის მეშვეობით Twitter-ზე და /r/firefox განყოფილებაში Reddit-ზე.

ძიება მხარდაჭერაში

ნუ გაებმებით თაღლითების მახეში მხარდაჭერის საიტზე. აქ არასდროს მოგთხოვენ სატელეფონო ნომერზე დარეკვას, შეტყობინების გამოგზავნას ან პირადი მონაცემების გაზიარებას. გთხოვთ, გვაცნობოთ რამე საეჭვოს შემჩნევისას „დარღვევაზე მოხსენების“ მეშვეობით.

ვრცლად

where is the addons directiories in window?

  • 7 პასუხი
  • 1 მომხმარებელი წააწყდა მსგავს სიძნელეს
  • 12 ნახვა
  • ბოლოს გამოეხმაურა Shadow110

I'm writing an Addon. I have folder with some css files and js files. the "content_scripts" JS file is in the same directory as style.css. in style.css i write st. when i use @import url("style.css"); in my JS file, it doesn't work but when i uploaded the style.css file in my server and use @import url("http://domain.com/style.css"); i saw that it works. so now i don't know how to address the css font in JS when they are in the same directory. thank you.

I'm writing an Addon. I have folder with some css files and js files. the "content_scripts" JS file is in the same directory as style.css. in style.css i write st. when i use @import url("style.css"); in my JS file, it doesn't work but when i uploaded the style.css file in my server and use @import url("http://domain.com/style.css"); i saw that it works. so now i don't know how to address the css font in JS when they are in the same directory. thank you.

ყველა პასუხი (7)

Maybe try to use the full path starting at the root and possibly use a separate css and js folder (e.g. /css/style.css).

See also:

cor-el said

Maybe try to use the full path starting at the root and possibly use a separate css and js folder (e.g. /css/style.css). See also:

thanks for answering but it doesn't help me. do you have any other idea?

Documentation says that you have to declare "css" in the manifest. And css is An array of paths, relative to manifest.json, referencing CSS files that will be injected into matching pages. Files are injected in the order given, and before the DOM is loaded.. So I think that you don't have to import it, css files are injected due to declaration in the manifest and ready to use.

TyDraniu said

Documentation says that you have to declare "css" in the manifest. And css is An array of paths, relative to manifest.json, referencing CSS files that will be injected into matching pages. Files are injected in the order given, and before the DOM is loaded.. So I think that you don't have to import it, css files are injected due to declaration in the manifest and ready to use.

Thank you for answering. I edited my manifest.json and edited the "content_scripts" part as bellow:

     "content_scripts": [
       {
         "matches": ["<all_urls>"],
         "js": ["frontend.js"],

"css": ["font-face.css"],

         "run_at": "document_start"
       }
     ],

but it doesn't work me. It made me crazy!

I'm afraid you have to ask them : https://discourse.mozilla-community.org/c/add-ons/addons-mozilla-org. People there are more familiar with addons development.

TyDraniu said

I'm afraid you have to ask them : https://discourse.mozilla-community.org/c/add-ons/addons-mozilla-org. People there are more familiar with addons development.

Thank you TyDraniu, I opened a topic there.

You can also try here : https://stackoverflow.com/