Show all bookmarks using javascript - javascript

I'm trying to list all of my bookmarks using Javascript. Is there any way that I can accomplish this? Thanks in advance for any help.

In web design, there are some limitations due to security. Such as this, javascript would have to read your web folder on your computer and display the information from your computer. That would be bad security wise.
Use social bookmarking, and update it when you need to.

The only way to show your bookmarks is though xul aka an extension if this is what you want then look up places api. Places is a sqlite database located n ur profile folder.It's name is places.sqlite

If you use Firefox, there is a file called bookmarks.html in the profile folder. You can open this file and insert some JavaScript.
But as mentioned before, you can't (for good reasons) not access the bookmarks directly using JavaScript from any page.

Related

Is it possible to using web api and open a local folder? [duplicate]

We are currently looking at porting a enterprise silverlight application over to html5. The major roadblock that we have hit is the ability to open files from the user's local disk. Currently they have a document library which just links to files on their computer that they can open from within the app and view or print out. All that I read is that you can only access the local sandbox of the web app with the html5 file api's. We want to load these files from code.
Does anyone know of any workarounds to this?
Thanks
There is no way for html5 to access local file without user selection. But FSO: FileSystemObject works for IE and MAYBE could be regarded as a work around. But still there are some requirements to meet.
It is possible to use chrome's filesystem API to access files on a users local filesytem. So you'd have to be willing to make this a chrome only application.
Using java you can create a "Signed" applet which has access to the local filesystem. (if the applet is signed you can request filesystm permissions)
then there is a tutorial for accessing methods of your java code directly from javascript here: http://docs.oracle.com/javase/tutorial/deployment/applet/invokingAppletMethodsFromJavaScript.html
you should be able to perform something similar from silverlight.
There is no workaround in pure HTML5/Javascript. You need the use of plugins, such as Java or Silverlight (maybe you shouldn't port it after all). As for workarounds, HTML5 gives you an easy way drag and drop multiple files that you could transfer on the server and then display back to your users. Another workaround would be to install a custom agent (a software with only a tray icon) that would send the information about the current user "document library" to server and then again, you could display it back to the user.
Note: I've heard somewhere that browsers will eventually stop supporting plugins. http://www.howtogeek.com/179213/why-browser-plug-ins-are-going-away-and-whats-replacing-them/
Ya, I agree with Markain. However, if you were to limit your audience solely to chrome users, I daresay, you would most likely use some of your users. If Huazhihao is right, then your number of leaving customers should decrease but users who regularly use firefox won't be happy. Overall, I think that this will not work. Otherwise, there would be too many websites that trashed your hard driver (or at least wherever you have the rights to edit/delete files). I think it would be best if your product was setup to synchronize the file whenever an internet connection was detected and a change was made to the file. That way the user would not need to visit the website whenever the file was uploaded. If this is some kind of an error file, then it would be most beneficial if you were to make a link in the application that when clicked, would upload the file to the website and the website were to do whatever was necessary. If this is a purely online thing, then I don't see what business you would have looking through other peoples' files =-). Hope I helped!

How to search the Local file system of Windows using Javascript?

Operating system : Windows 8.
Input-from : A text field from a html page .
Input-type: text.
Output : the file that was searched.
What I want : I want the user to enter some keywords and have JavaScript search the user's local files...
Is there any way? or A javascript Library?....
And how I can query the file system about the files using Javascript..in Windows..
EDIT::
Thanks everyone for the reply...
The way I get it is ,either I have to develop my own browser based in Java that has sufficient permissions.. or
I would have to implement a file crawler that indexes everything that sends that file to the a server , so that javascript can then access it through xmlhttp requests to the server ....
This was just a curiosity and I don't want to expose anyone's personal files on the Internet.
A fun project.. That all tinkered in my mind.
This is not possible from a web page because of the browser's security restrictions. You could access the local file system with Node.js or an Electron app, but I don't know if that would suit your use case
No. That's simply not possible and even if it is, it should not be used, as it would make one's local file system open to various threats because you are directly exposing your machine on the internet. That's sufficient enough reason for a webapp not to access one's local file system in any manner whatsoever.
P.S: If you really want it, There are a few third party libraries which use Sandboxed file systems. You can try that if you want.
I havent tried it personally, but found the below link via quick googling so i am not sure if its officially supported up until now.
https://www.html5rocks.com/en/tutorials/file/filesystem/
Use <input type="file">, which implements ability for user to select file from local filesystem.

Is it possible to access a local file from a browser on a mobile device?

Question:
Let's say I create an android game that saves a save file(in the form of a text file) on the local android internal storage and I know the absolute path where the file is saved. Is it possible to create a website with a built in script that retrieves this textfile and displays the save data to the user? If not, why and are there any unconventional ways to get around it?
From my own research, I have seen similar topics give pretty mixed results. Some say that the browser is sandboxed, while others say that it's now possible. Any clarification would be appreciated! Thanks in advance!
It may be possible if you have a local web server running on your Android Device. If you can save the file to the Web Server Document folder, you can then access the file from your browser. I haven't tried it, but it sounds logically possible.

How to read data file from client machine in wan

Is there any way to read the contents of a text file from a client browser? For example, I would like to let the user click on a button to place the contents of C:\cmd.txt into an html element for view.
This will not be possible without user consent (I hope!!!). A website can not read a file on the client machine without asking the user. Think of all the security risks it would imply if it could...
Your solution could be to ask the user which file to open and then have them select the c:\cmd.txt file. After that, reading the file is easy.
Hope this helps
#Rick van den Bosh is correct as to your basic options using native HTML and javascript.
The only additional options would be a Java applet or browser plugin. However, your users would have to trust you enough to install your control, and savvy users aren't going to do that unless you are a major site like amazon.com or cvs.com or some well-known commercial enterprise.

How can I write javascript that will load and print a web page to an image file and put that file in a specified location

Here's what I want to do:
Load a web page from a specific
location
Print that web page into a jpeg,
png, or other graphic file format
Upload that image to another site,
or save it to a location on my local
network
I know about window.print(), but that always seems to open up a print window, and I'd like to do as much of this operation silently as possible.
Essentially, I want to be able to take a snap shot of the web page so it can be put in a directory that is accessed by one of those electronic picture frames. They can either access a web-based service, or a directory on the local network.
Thanks in advance for your help,
Rben
Browsers will not let you print "silently", because if they did websites all over the place would use them to overload your printer with spam. There's no way around it (and if you found one, they'd close it as quickly as they could).
So, you could either a) create a browser plugin or something similar that gets you outside the broswer's "sandbox", OR, b) write a web crawler app that obtains the web page, and find some other technique to render it into an image (drive a browser programmatically perhaps).
If either of those sounds promising, let me know and I can fill in more detail on how to go about them.
You can't do that using javascript. wkhtmltopdf can help you. Here are the list of tools available to do it in this SO discussion.
I put together a script i think might be just what your looking for... Screenshot Demo.
It uses printElement and Feedback.js(Can't remember the source) and it allows you to screenshot the whole webpage and either send it as an email or to a printer.
Let me know if this helps and sorry i have no put more detail about it on the page but I am at work at the moment lol

Categories

Resources