Is it possible to change the 'matches' value in my Chrome extension's manifest.json file after installation? Maybe through an options page or something? I'd like to provide the ability to lock my extension to a domain but the domain will change per user afterwards.
"matches": [ "*://*.whatever.com/*" ],
I'd like my options page to be able to change this value. Does anyone know if this is possible or practical? And if so how might I do it?
Related
I'm creating a chrome extension that should be able to be accessed by the user on any website they are on. I don't have any content scripts, only popup.js and background.js. Would I need to have my host permissions in manifest V3 like this? Or am I able to omit the host_permissions?
"host_permissions": [ "*://*/*" ]
No, you don't need to add host permission unless your extension needs to interact directly with the users browser/client data, for example cookies, webRequest, and tabs.
this article helps:
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/host_permissions#:~:text=Use%20the%20host_permissions%20key%20to,a%20request%20for%20a%20permission.
I am making a chrome extension which would do "some codes" after I get to and load some websites. For example, the prefix is "https://stackoverflow.com/". I want to monitor the urls of the tabs. The "some codes" would be executed after "https://stackoverflow.com/~" webpage loaded. How could I do it? I have no idea especially about how to monitor the tabs?
I will be thankful for any suggestions.
You can use Content Script to execute code after the URL you monitor opens and the page loads, however you have to mention URLs you monitor in the Matches part of Manifest.json file.
Read thorough the Chrome Extension documentation here
Is there anyway to change google chrome homepage url by an extension.
I'm trying to write a simple extension which can change homepage url.
Hope you can help me.
It is possible, and a quick search reveals that such an extension already exists.
If you want to do it yourself, you can have a look at the Override Pages documentation. You can change the New Tab page, and therefore can simply implement an HTTP redirect in Javascript to the page you want.
Insert this code to manifest.json:
"chrome_settings_overrides": {
"homepage": "http://www.homepage.com"
}
I have a chrome extension where the popup.html simply has an iframe that loads a page.
I want to allow users to select their language, and as I'm helping a charity do this each language page is very different as they need very different content based on the country!
Therefore, I can't just replace some of the fields like the google developer page example does; I need to change the page that is loaded in the iframe.
e.g. In my directory where the pages are stored I have english.html, german.html, spanish.html all of which are completely different pages.
By default the english.html page loads in the iframe, but the user should be able to go into the options file and select german so when they click on the extension the german.html loads by default every time.
Here is the jsfiddle showing what I currently have in the popup.html, and the popup.js:
http://jsfiddle.net/hemang2/EDV82/
You'll see the flickr API being called, but that's only there because I wasn't sure how to get rid of it!
So essentially my question is how to link the options file to change the default url loaded in the iframe.
Use the setPopup method: http://developer.chrome.com/extensions/browserAction.html#method-setPopup
It allows you to set any html file as your popup.
I am using views module. I have created blocks using views and a url using page display. This is for taxonomy. So my views url looks like this "news/science" So if someone click on the link he should be taken to www.example.com/news/science. However i am taken to a unstyled page with broken links. But when i try to use the url www.example.com?q=news/science i am taken to a proper page with correct data.
The issue is only with taxonomy related terms.
i.e all urls www.example.com/news/technology , www.example.com/news/sports appear broken and unstyled however if i manually visit www.example.com?q=news/technology and www.example.com?q=news/sports i am taken to a proper page.
Can anyone suggest what could be the reason.
The same issues is with admin login and logout. If i use www.example.com?q=user and try to login i can login. Also if i use www.example.com?q=logout i can logout. But if i use clean url aliases ie. www.example.com/logout then i am taken to access denied page.
Do you have the Path module enabled? Thats the module responsible for mapping ?q=logout to /logout.
See here: http://drupal.org/handbook/modules/path
Have you changed anything in .htaccess? any mod-rewrite changes that might be skipping over those particular urls?