icons in a firefox android bootstrapped extension - firefox-addon

I'm working on a bootstrapped extension for firefox android, and I have a problem with displaying icons in a new menu item:
itemMenuId = window.NativeWindow.menu.add("Show more details",ico , function() { showToast(window); });
in ico I wrote the uri of the icon file existing in the root of my extension (icon.png is next to bootstrap.js), using data: and file://, like described here but the icon isn't displayed. I don't know how to fix the path for that. Beside I'm having the same problem with the iconURL in the install.rdf file, when I use chrome:// I get nothing, and when I use resource:// I get a missing image. Should I have chrome.manifest to use chrome://? and even if I don't specify the url,to let the image be displayed by default like here it still doesn't work.
<em:iconURL>resource://trackdetect/icon.png</em:iconURL>
I googled it ,but, I couldn't fix it. Please help and thanks.

For the issue, just make sure you have a file named icon.png in the root of the XPI (the same folder as bootstrap.js) and the image will be used. You don't even need the entry in the manifest. See: https://developer.mozilla.org/en-US/docs/Install_Manifests#iconURL

Erik Vold's guide explains how to reference files packaged within a bootstrapped extension.
However it is strange that the icon doesn't appear at the addons list (you don't specify a iconURL, just place icon.png next to bootstrap.js, as you did). Perhaps you should check if the tool you use creates PNGs that conform to the standard.

Related

How to install my own firefox extension

I am new to FF extensions development. I work on Windows OS. I am using web extensions. I started my first extension. I created a directory in My Documents which contains my extension files. The files are based on the example in: Your First WebExtension which are: manifest.json, icons/myicon.png, myextension.js. Like the example, all what the extension does is a border aroud mozilla page. This is the js code: document.body.style.border = "5px solid red";
When I come to installing the extension in my browser, I navigated to:about:debugging then I clicked in the Load Temprary Addon button and I selected the the .js file. I get this error: There was an error during installation: Extension is invalid. Can you point what the problem is?
Most likely an error in the manifest.json file. Double-check that code; if it all looks good, try temporarily removing optional things from it, then removing-and-reloading your addon in the debugger until it works. Then you can narrow down what's up (hard to say exactly, without seeing your code). The most minor error in the JSON will result in the addon failing to load (such as an out-of-place bracket, etc).
See also: Anatomy of a WebExtension
Problem with my setup was incorrect use of content_scripts.matches, correct solution for a "match-all" is
"matches": ["*://*/"],
Attribution : https://discourse.mozilla.org/t/web-extensions-noob-getting-there-was-an-error-during-installation-extension-is-invalid/12828/3
The problem was that extensions must be saved in specific directory. In winows, the directory is: C:\Users\"YourUser"\AppData\Roaming\Mozilla\Firefox\Profiles\"YourFireFoxProfile"\extensions
After that, try the steps I mentioned in the original post and you should find the extension added.

Appcelerator : ImageView and local files

for two days now, i have been looking for the correct place to put my local images and the correct way to access them in the Appcelerator platform (working with Alloy framework).
All i want to do is simply display a local image through an image view component. It works well with an image get from URL but seems impossible to get it from a local file.
this is an simple image view declaration in my index.js controller
/app/controllers/index.js. Where do i have to put my image to get this code working?
var img = Ti.UI.createImageView({
image:'images/DefaultIcon.png',
top:10,
width:100,
height:100
});
$.index.add(img);
I have read all the documentation about that issue and read a lot of similar questions over the internet. Anyway, none of the answers i've been reading bring me the correct solution.
No matter where i put my images into my project directory (assets folder, root folder, resource folder, image folder), those images seem to be not accessible !
I'm currently developing on iOS platform...
I really hope some of you guys have the solution ...!
Best regards,
Quentin
You need to put the images in the /app/assets/iphone/images folder.
Within that folder you can create as many folders as you'd like, the only thing you need to do is update the path accordingly.
So, you have an image with the name myIcon.png. Put this in /app/assets/iphone/images/myIcon.png (and don't forget to include #2x and #3x images in the same folder).
Then, in your imageView use this path /images/myIcon.png.
Want to put it in a folder? For example /app/assets/iphone/images/icons/myIcon.png then reference it in an imageview with /images/icons/myIcon.png.
For android you too need to use the images folder inside app/assets/android. But to specify dimension specific images you can put them in ldpi, mdpi,hdpi,xhdpi,xxhdpi and xxxhdpi folders as specified by Android

Phonegap, phonegap build and tabbar

I have been working on a project in phonegap that requires an iOS tab bar at the bottom. I haven't been able to find a working plugin so with the little knowledge I have in objective C, I took this one and modified it so it works with what we need:
https://github.com/tblomseth/cordova-ios-tab-bar
(note that I didn't change anything with the tab bar function)
I am trying to add custom images to my tab bar, and I understand that I can apply said image with the 3rd parameter defined in the www/tab-bar.js file.
TabBar.prototype.createTabBarItem = function ( name, label, image, options ) {}
My problem is i don't know enough about how phonegap build compiles the application to know how to reference the image for the ios code to take over.
The code that takes the image and applies it to the tab is the following:
item = [[UITabBarItem alloc] initWithTitle:title image:[UIImage imageNamed:imageName] tag:tag];
as defined in src/ios/CDVTabBar.m of that repo, but my question is how do I reference the file name for the image? I've tried the following:
Full path
single file name
single file name with reference in config.xml file
None of the above methods have worked.
I was able to figure this out!
I first thought that the image was moved into some kind of bundle that I needed to know the path to, however its not, it's placed in a file similar to a plist lookup.
My file ended up being called www/img/icons/tabs/history.png when i was using:
/www/img/icons/tabs/history.png
history.png
/img/icons/tabs/history.png
The way I was able to find what to call the file is as follows:
Download the APK file from PhoneBapBuild on my Mac
change the .apk extension to .zip
unzip the file
browse the package contents of the payload
look at the file called CodeResources inside the _CodeSignature directory and found the filename.
As soon as I put the string that matched the string in this file, the image showed up just as it should!

Online Addon Builder - How to display custom icon for the extension inside Firefox's Addon Manager

Online Addon Builder - How to display custom icon for the extension inside Firefox's Addon Manager?
I know that's a more general question and before I can even submit this someone is going to throw a link at me but I've been there trust me...
I've built my addon using the online addon builder but I'm not ready to submit it to AMO for review quite yet as I feel it needs more to be complete. I can't find specific information relevant to exactly what I want to do using to online addon builder. I've installed and configured the localized SDK that is utilized using a tool called cfx and of course theres tons of documentation!
The Question: What all notable values can be set using the package.json that determine how the addon is displayed inside Addon Manager? What notable material/configurations can't be set using package.json and how do I implement them?
I've removed all warning and errors from my code but I'm using a hardcoded path to a image whereas before I was passing it as an arguement within the PageMod object to a content script. Why? I'm not sure but I know one of you know how to configure the extension where I can specify chrome://ez-magnetz/data/icon16.png or somehing similar. Which is better than using a JUID in the path name that can change.
My widget has an icon but how do I specify a primary icon for the extension to be displayed in the AM? (package.json||chrome.manifest)
Using the latter of the two(chrome.manifest) how do I include that inside my addon so that its detected?(For the purpose of an Extension Icon using the online addon builder if possible)
Will someone please provide me with a chrome.manifest template for a basic addon?
Do I need the install.rdf and what has precedence over configuration is it like:
install.rdf>>>chrome.manifest>>>package.json
I noticed very similar settings amongst them.
I've been to XUL school I see that there is useful information it just seems outdated in the context of my addon.
I've read the basic info on the package.json and implemented simple prefs and of course the addon's description.
My understanding is that I've created a bootstrapped addon using
Mozilla's Online Addon Builder. Is that correct? The only thing I
wish to do now is to have a personal icon displayed for my extension
in the Addon Manager!
+ I'd like to know how I may have and option for users to donate on AMO!
Thanks for any help in advance
To add an icon, just follow these two steps:
upload the icon you want to use to the data directory of your add-on, eg 'data/icon.png'
Add the relative path to the png file as an extra JSON property in the add-on info dialog, for example this:
{
"icon": "data/icon.png"
}
See this screenshot for an example of what it should look like:
https://dl.dropbox.com/u/44296964/Screen%20Shot%202013-01-07%20at%202.15.49%20PM.png
Aside: please only ask one question per post.

Custom icons in sharepoint 2007 document library view

I need to change the folder icon in a sharpoint document library view.
The catch is, the folder icon is dependent upon various folder properties. So, I need a specific icon for specific folders (I just don't want to change the folder icon across the board).
My initial thoughts were, that if I could find the page (xml or aspx) that sharepoint uses to generate the img tag, I would modify the source to be something like:
src="/GetFolderIcon.aspx?fn={FolderNameHere}"
Where {FolderNameHere} is the actual folder name. Then, in GetFolderIcon.aspx, I would look up the various folder properties, and determine which .gif or .jpeg I needed to send back to the browser.
The problem is, I don't know where that page is located, or what it's even called.
I don't know if that's the correct approach or not, but that's my current thoughts.
Any suggestions on how to do this?
Thanks!
here is a tutoral on something very similar.
http://blog.pathtosharepoint.com/2008/09/01/using-calculated-columns-to-write-html/

Resources