I need to develop some sort of browser plugin/extension to track search string on some search engine web site, ex: google.com, bing.com.
From the research, for chrome extension, I saw somebody suggest content js is the way to go. Is it true? Is there a cross-browser approach?
You can use Content.JS or any other JS library you like for developing an extension but with only JS library you cannot develop an extension.
There is a specific way for each browser. It contains at least 4 files.
(1) Manifest file (2) HTML file (3) JS file (4) CSS file
You also need to refer browsers object model.
You can refer links below may help you to get more information.
(1) Creating a Microsoft Edge extension
(2) Getting Started Tutorial to create an extension for Chrome
(3) Your first extension for FireFox
To support cross browser functionality, You can try to port your chrome extension to Firefox or MS Edge. To get more information on porting an extension, you can refer links below.
(1) Porting an extension from Chrome to Microsoft Edge
(2) Porting a Google Chrome extension
Note:- You also need to refer policy of each browser to access browsing data of users. It can be possible that all browser has some difference in their policies.
Related
The filesystem API cannot be used by unpacked extensions, which is awfully great for development.
But then the real surprise came when I realized I can't use it also with my extension packed, because Chrome tells me it cannot find it in the store and is thus greyed out.
Is there any way to actually develop with the filesystem API then?
My goal, in case this is the wrong direction in the first place, is to write some text to a file when some events in the browser happen. The file should be rewritten, rather than creating a new file, which is why I can't use the downloads API.
Is there any way out of this conundrum?
For anyone stumbling on the same issue - a decent solution is to use the chrome.downloads API to download the file in overwrite and incognito mode.
Overwrite will stop the automatic indices added to downloaded file names, and incognito makes the download invisible in the browser except for incognito windows.
The main shortcoming is that it is of course constrained to the user's downloads folder.
I have a NPAPI plugin , running fine in firefox. Now i want to port it to chrome browser, means i want it to work in chrome also.
But i have learnt after browsing on internet and many links that chrome no longer supports NPAPI rather now it supports pepper API and now there is concept of native client.
What i have developed an understanding so far is that if i replace the NPAPI code(made for plugin for firefox) with the Pepper API code and upon compilation, a pexe file(native client module) along with manifest file(which is referring to the location of the pexe file) would be generated which would be kept on the server.
when an html page having embed tag describing a particular MIME type, say "application/x-pnacl" is loaded, then via src attribute(referring to the manifest file) of embed tag, manifest file is fetched which then fetches the actual pexe file which is then run by/within the native client plugin(already present in chrome).
I am not sure whether this understanding is correct or not. I was assuming that just like firefox plugin, pexe file would be stored and installed on local user PC and then detected/loaded by chrome as a plugin. Please tell whether this is correct or not.
Also, I want to ask whether still there exist any way to run NPAPI plugin in chrome or not. If it is please tell otherwise i should not think about it.
First, Chrome no longer supports NPAPI plugins for security reasons:
https://support.google.com/chrome/answer/6213033?hl=en
Plugins must use the Pepper Plugin API (PPAPI) and be compiled as Native Client (NaCl) executables so the plugin binary can be validated as safe to run. Portable Native Client (PNaCl) plugins can be loaded by any web page without the user installing anything. However, if your plugin is large, you may want to distribute it as a Web Application through the Chrome Web Store. In that case, you can bundle your .nexe's or a .pexe with your application so it is effectively installed on the user's machine.
This link describes how you can distribute your plugin:
https://developer.chrome.com/native-client/devguide/distributing
I added two extensions to my google chrome that I want to send to some extern users, which are not "technical" people (I mean that they don't have IT skills). Instead of showing them how they can download and add an extension to their google chrome, I want to simplify this task by sending them an installation file of chrome (or chromium) which already contains these two extensions. So, in this case, the only thing that they have to do is just to do a normal installation (with the .exe file since they use only windows) like there are installing a normal google chrome! After that, they will have a chrome which already includes these two extensions.
Can you tall me how can I do that? because I have no idea of it..
Thank you!!
Chrome has instruction for doing this here: https://developer.chrome.com/extensions/external_extensions. You should be able to do it via a registry addition.
Note, as of Chrome 33, you will need to publish the extension to the store, and you just add update urls. Chrome does not allow installation otherwise for security reasons.
I would like to create an extension or app for the Chrome browser which would require access to a user's Google Calender (for creating new appointments).
I am unsure of which technology to better research and use, Chrome extensions or apps. My "app" wouldn't need much of a GUI, so I'm leaning towards extension — but I don't know if this would pose any difficulties for accessing a user's Google Calender to add an event.
Anyone one have any idea which technology is best for this situation, and why? Thanks!
Either, or... Go with an extension if you'd like.
I assume you've looked at the API reference?
https://developers.google.com/google-apps/calendar/
From there, I'd imagine you'd just need OAuth to authenticate the user. Here's the JS library:
https://code.google.com/p/google-api-javascript-client/
There are pros/cons of each types, apps or extensions.
Apps
If you would like to create a client application of Google Calendar which has many rich GUI components, this type will become a better solution.
In addition, Chrome apps can communicate with many hardware devices and other servers. Of course, your Chrome app can become as a server (that is, your app can open a server socket and accept a request from other client apps).
Chrome apps can be executed not depending on your Chrome Web browser. That is, Chrome apps cannot access to a context of your Chrome Web browser.
Probably, you don't want to get the pros above, I guess...
Extensions
If you would like to create a small UI for posting your schedule to Google Calendar, this type will become a better solution.
In addition, Chrome extensions can access to a context of your Chrome Web browser. That is, your extension can get page contents of each tab and inject your CSS and/or JS code. For example, your extension will get a URL of some opened tab and include it in a body of the posted schedule.
Chrome extensions completely depend on your Chrome Web browser. That is, your extension cannot execute independently.
Also, generally, high cost will be needed to develop Chrome apps than Chrome extensions. As the result, you should choose Chrome extensions, I believe.
I compile the extension using the --pack-extension switch:
C:\Users\APOL0\AppData\Local\Google\Chrome\Application>chrome.exe --pack-extension="D:\MyExt"
Everything works fine: chrome generates Myext.crx and Myext.pem but I don't know how I can get extension ID for automatic installation using Windows' registry.
How can I get this ID without using "manual verification", ie. programatically?
Edit May 14, 2018: Added clarification and link to 3rd party tool.
There is no official supported method (at time of writing) to programmatically get the extension ID from a CRX without manually interacting with Chrome. (See official method below)
Unofficial Method
The only programmatic method I've found any reference to online is on this SO answer. The author of the answer later posted a link to a ChromeIdGenerator tool they wrote to accomplish this. The tool is based on how Chrome calculated its extension IDs at that point. Full disclosure: I have not tested the tool to ensure its accuracy, it is simply the only tool I've found to accomplish what you're asking.
Official Method (manual)
If you open up your Chrome Extensions manager page, you can drag and drop your Myext.crx onto the page (you must be in "Developer Mode") and it will load your extension, showing you the new extension id.