is it possible to open the plugin extension window with a url? - google-chrome

I am trying to build a chrome extension. Now, My usecase is that, Clicking on the plugin icon should hit a url hosted at a server, and the response for the url should be rendered in the plugin window. Is it possible ?

A simple <iframe> inside your HTML will serve your purpose, unless you run into a page that actively prevents framing; then I don't think this is directly possible.

Related

Cordova: open link from webview in target blank without plugin

I have a simple cordova app with this is my config.xml:
< content src="http://example.com" />
In other words, the app simply loads an website.
The problem is that this website has some hrefs with target="_blank" but the webview doesn't open the default browser when the link is clicked/tapped; the link is loaded inside the webview.
I know that there's the InAppBrowser plugin, but i think I cannot use it with this approach (the hosted webpage would not load the plugin).
Does anyone know how to deal with this? Any recommendation?

How to open a pdf on same page using pdf.js

I want to open up a pdf page on a web page on click of an icon and I want that page to be opened on the same page. I tried to use - pdf.js, but I am facing problem in running helloworld of pdf.js. So how do I use odf.js locally?
Link referred: https://github.com/mozilla/pdf.js/tree/master/examples/helloworld
Thanks
Probably not the issue you are experiencing but you will want to turn off web workers if you're using PDF.JS in multiple instances on the same page.
PDFJS.disableWorker = true;
it does not work with file://, you need to upload the files to your webserver, because AJAX just works with a webserver and not on the clientside

Accessing a Drive Preview from an iFrame in Chrome via SSL

I have an application that uses Google Drive for document storage and preview functionality, but recently the iFrames that the documents are loading into are not displaying anything. Upon inspection of the console, Chrome declares that it blocked the fram from running insecure content, and that is why the file preview did not load.
The initial call to preview this file is to a url that looks like this:
https://docs.google.com/document/d//preview
There is a redirect along the way that takes the following form but because it uses http instead of https, Chrome blocks the content from loading.
http://www.google.com/url?sa=p&q=https://www.google.com/accounts/ServiceLogin?service%3Dwise%26passive%3Dtrue%26go%3Dtrue%26continue%3Dhttps://docs.google.com/document/d//preview?pref%253D2%2526pli%253D1
Is there any way around this issue? It is blocking a core functionality of my application currently, so any advice would be appreciated. I can provide a screenshot of the full stack of network loads in necessary, but this is the only URL that is not http compliant.
Thanks in advance for your help.
Hacked that. Add a "?pli=1" without quotes at the end of the URL to avoid redirect (after "/preview" or "/edit") and land directly to the document.

Embed web inspector console in a page

Is there any way to embed "console" tab from chrome web inspector in a page?
Unfortunately I do not know of a way to do this in a normal web page in any browser but you could make an Electron app and perhaps show the inspector whenever you want for the user.
If you are looking to embed a JS console emulator on your site, perhaps to show off raw JavaScript, you can use YourJS Console. It also gives you the ability to initialize the console with custom code or a GitHub Gist.

How to use chrome extension methods in my asp.net page?

I have page where RSS icon is present. I want that when user clicks on RSS icon it will check in chrome browser that, whether that RSS reader chrome extension is installed or not
I am trying to achieve this by using chrome extension methods, mentioned here.
I tried something like this but it is not working:
var port = chrome.extension.connect("nlbjncdgjeocebhnmkbbbdekmmmcbfjd");
To use this API you need to be either an extension or a web application having the necessary permissions - normal web pages cannot access it. However, detecting whether an extension is installed in Chrome is still easy:
<script src="chrome-extension://nlbjncdgjeocebhnmkbbbdekmmmcbfjd/manifest.json"
onload="alert('installed')" onerror="alert('not installed')"></script>
This uses the fact that the extension's manifest.json file is located under a predictable URL and that web pages are allowed to load this URL. Of course, this isn't an officially documented approach but rather a loophole and a privacy issue. So be prepared for it to stop working in some future Chrome version. At the moment it works however.