How to compare the content of a website with a database? [Chrome Extension] - javascript

I have a question regarding the development of a Chrome extension.
I want to scrape the content of a website and compare all plain text with a database.
When a word of the scraped content is the same as in the database a message will be displayed in the extension popup?
Is this possible to create?

Yes, it is possible.
To accomplish this, you would need to use the Chrome Extension API to interact with the web page and the extension. You could use the Content Script API to scrape the plain text from the webpage and send it to a background script for comparison with the database.
In the background script, you could use a library like WebSQL to store and query the database. When a match is found, you could use the Messaging API to send a message to the extension popup to display the message to the user.
Be sure that you are not violating any website's terms of service or data privacy laws. It's important to properly secure any user data that is stored or transmitted by the extension.

Related

Outlook Office Add-In Integration with Third-Party Web Application - alternative to mailto links to support attachments and HTML body

From our web application running in company network, I'm looking for an alternative way of "mailto" approach (since "mailto" supports plain text only for the body section and has no attachment support) for opening up a new message (email) popup in Outlook (company uses Outlook). I'm trying to implement this by JavaScript.
After some search, I think I have 2 options available:
Handling mail sending operation via our web application by opening a send mail popup, including attachment and nice looking html body template,
Trying to integrate our web application with an Outlook office add-in
This web application is for purchasing department and Outlook usage of them is high.
If option 1 has been chosen, I think there will be a need to present previous mail recipient suggestions and sent mail history page.
I'm not exactly sure that option 2 can be implemented, or provided by Outlook.
Any suggestions will be highly appreciated. Many thanks in advance.
IMHO the only reliable way to show a new message in Outlook from a browser other than IE is to dynamically create an EML (MIME) file with HTML body and attachments populated. Just make sure to add "X-Unsent: 1" MIME header to show the message as draft and avoid populating From/Sender MIME headers.
None of the options described are valid. And I will explain why:
The web application can use Graph API if you deal with O365 or EWS if you have Exchange on-premise profiles. In that case you could compose and send emails programmatically from your web application. But you need to handle all requests for the message history and etc. in the code. That's a lot of work I suppose! But if you don't need to show a list of messages like Outlook does, just to submit emails you could Graph API on the server to send emails.
Web add-ins are run under the context of currently selected mail/calendar items in Outlook. So, they don't have anything to help there.

What is best way to retrieve cookie/session contents from third party website?

CONTEXT
I am building a web app which analyzes information on a user's site. I plan to do this by asking the user to add a JS snippet to their <head> which creates cookies that collect information about each visitor to that site.
PROBLEM
I would like to then send information that is held in this cookie back to my web app. I realize normally cookies cannot be accessed by anything other than code on the same domain, so I'm hoping that the JS snippet will read the content of that cookie and pass it back to my app - is this possible? What would be the best way to do it?
This is the basic pattern that's used by google analytics and most other website analysis tools as well as advertising modules. Your snippet, running on your user's site, can read/write cookies there. It can also make ajax calls to your own web service to communicate any data it gathers, including cookie contents. Your "app" doesn't run on your user's site, only the snippet (and any code it drags into the site).

Programatically connecting to a website on a server from another website

Is it possible to connect a server to a website, where I can access the server from another website and if I click submit, it programmatically clicks a button on the website connected to the server?
Is this possible to do in Javascript(if not, any idea on how to implement this?)
Based on the comments you've provided, your question seems to be specific to gmail. If that is the case, google offers an API that will let you perform operations from your code that would normally be performed by a user.
https://developers.google.com/gmail/api/
From the site:
What is the Gmail API?
The Gmail API gives you flexible, RESTful access to the user's inbox,
with a natural interface to Threads, Messages, Labels, Drafts, and
History. From the modern language of your choice, your app can use the
API to add Gmail features like:
Read messages from Gmail
Send email messages
Modify the labels applied to messages and threads
Search for specific messages and threads
This is possible on any development environment I used this in C# Asp.net and in python. Simply you can use a WebClient object in asp.net. You can click any button and you can set any area on target machine like for user login name and password. Even robot control on logins is exist just for this reason
http://www.codeproject.com/Tips/488939/Get-page-HTML-from-URL-using-WebClient-Strip-HTML
Can't login into asp.net website with WebClient

How to make a user scan the html of another website

Is there a way for me in javascript to enable a user to parse a html page as they would see it.
So imagine a button on my website and if they click on it, I get a javascript string which contains the entire html page of e.g. bbc.co.uk, as that user sees it.
Is that possible?
Arbitrary 3rd party websites? No. If you could do that you could read people's bank statements from their online banking, the email from web mail services and so on. This security measure is called the same origin policy.
You can read data from co-operating websites via CORS (for HTTP requests) and postMessage (for frames).

Store and retrieve data online using a userscript

i want to be able to store and retrieve data online using a username and a password so a userscript that runs on a webpage can have personalized information.For example i want to write notes for users in a forum and want to retrieve them from any computer that my userscript is installed.
I thought google spreadsheets would do the trick but i havent been able to implement it.
I also have thought of using something like persistencejs https://github.com/zefhemel/persistencejs/blob/master/docs/sync.md or http://www.sencha.com/products/io/ but neither of them are simple enough for the knowledge on programming i have.
So is there a simple way of doing this?
there is no easy way to do this, you have to store data in your server and create a connection between your server and userscript.
here is how you can do that,
create a login box in your userscript, so users can login.
get username and password and send it your server page with GM_xmlhttpRequest.
chrome and firefox support cross domain xhr with GM_xmlhttpRequest, so you will not have problem about that if you are writing that script for firefox or google chrome.
in your server page get username and password and check them for matching in your database, than create json response that contains data for matched user.
get response of request in your userscript and do what you want.

Categories