Tôi không thể tiêm CSS trong phần mở rộng firefox. Đây là mã của tôi.Tiêm CSS trong firefox thêm vào sdk
var tbb = require('toolbarbutton').ToolbarButton({
id: 'button',
label: 'us-button',
image: self.data.url('img/on.png'),
onCommand: function() {
tabs.activeTab.attach ({
contentScriptFile: [
self.data.url('jquery/jquery.min.js'),
self.data.url('jquery/jquery-ui.js'),
self.data.url('recuperation.js'),
self.data.url('dialog.js')
],
contentStyleFile: self.data.url('jquery/jquery-ui.css'),
Tôi sử dụng toolbar buttons bởi Erik Vold. contentStyleFile dường như không hoạt động. Khi tôi nhấp vào nút, hộp thoại JQuery xuất hiện nhưng không có tệp css.
Câu hỏi: tại sao * nên * nó hoạt động? [Tài liệu trên 'tab.attach()'] (https://addons.mozilla.org/en-US/developers/docs/sdk/latest/modules/sdk/tabs.html#attach%28options%29) doesn không đề cập đến bất kỳ tùy chọn 'contentStyleFile' nào. –
Vì vậy, làm thế nào để gọi thư viện JQuery khi tôi bấm vào một nút thanh công cụ? Tôi chỉ muốn hiển thị cửa sổ hộp thoại JQuery đơn giản. – seb68
Sử dụng tập lệnh nội dung của bạn để chèn một thẻ kiểu vào tài liệu? –