Changing background-image property to a local image file using Safari Extension - safari-extension

(MacBook Pro Mid 2015 / OS X Yosemite 10.10.5 / Safari 8.0.8)
I want to change background-image of a particular webpage.
I made a Safari Extension and make such a css file as style.css
body { background-image: url('background.png'); }
I also put background.png to the same directory with style.css
And Safari Developer license is already set.
Then, in Extension Builder, I set some properties as follows:
Extension Website Access: All
Injected Extension Content:
Style Sheets: style.css
Whitelist: http://__mywebsite__.com/*
Although I installed this, background of my webpage didn't seem to be enabled.
I think the solution must be these:
Safari Extension can't find a local file background.png
I set wrong whitelist pattern
I set wrong parameter to Extension Website Access
What should I do? Any comments would be thankful.

What happens if you link to an image on a web page, does it work? try putting this link in and see if it works: http://dummyimage.com/600x400/000/fff
If it does then the problem is with the directory or one of the other things you mentioned

Related

App not showing in open with in email client in iOS13 for pdf file

This was working properly in iOS12 but does not work in 13.1.2
Other extensions that are not public files work just fine.
I have tried changing the extension to “anyuniqueextension” and that doesn’t work. If I use the same info list code but change the extension to pdfx that will work.
Not sure of what to try next.

Why in Opera the 'chrome_url_overrides' is not allowed for specified extension ID?

I am making a cross-browser extension, which overrides the standard "New Tab" page.
There is a manifest.json key for that, called chrome_url_overrides:
"chrome_url_overrides": { "newtab": "index.html" }
It works in Chrome and Firefox! But in Opera (45.0) the following error occurs when I try to load the extension:
'chrome_url_overrides' is not allowed for specified extension ID.
Based on what I've read in the MDN chrome_url_overrides docs, Opera supports that.
Now I'm not sure if Opera doesn't allow that in general, or if there is a way to activate it?
Edit: I found a similar, unanswered yet, 3-months-old thread in the Opera Forums.
Actually Opera now officially does not support chrome_url_overrides. A piece of evidence can be found on the MDN page that you referenced and it was confirmed by an Opera representative in their forum.
A potential workaround for achieving a new tab extension in Opera (actually this should work in other browsers too) is to use a background script with the following code:
const redirectURLS = [
"opera://startpage/",
"browser://startpage/",
"chrome://startpage/"
];
chrome.tabs.onCreated.addListener(function(tab) {
for (let i = 0; i < redirectURLS.length; i++) {
if (tab.url === redirectURLS[i]) break; // user is trying to open startpage
if (i == redirectURLS.length - 1) return; // Tab is not trying to open a startpage
}
chrome.tabs.update(tab.id, { url: "index.html" });
});
Having this will check if the user tries to open a new tab and if this is the case it will open the custom index.html page that came with installing the plugin instead. It's a hacky and dirty and not sure if it's going to be accepted by Opera but still, this may be a path of salvation for someone desperately trying to get a new tab extension live among the other Opera Addons.
Fun fact: Opera developed and distributed an addon which helps you install chrome extension from chrome extension store on Opera but the new tab extensions don't work and fail upon installation with the following message:
[Compatibility notice]
Please, be aware that this extension requires APIs that are not supported in Opera.
It still can work in Opera, so complete installation to verify.
Opera's Acceptance Criteria say that:
Extensions cannot replace Opera’s default start page.
Even if you manage to accomplish your aim and replace the standard "New Tab" page, then the extension will not pass moderation.
Workarounds include assigning a keyboard shortcut to open your page, or launching it from a browser action button.

How to get html content remotely and open locally

I want to get the content remotely for a html page and open locally in the webview. But I want this html to have access to the Ti namespace, so it implies that the html must be running locally.
Have tried to create the webview passing the content as the "html" parameter, but Ti namespace doesnt work that way.
Then, I tried to write the content to a html file on Ti.Filesystem.applicationDataDirectory. The page opens OK, but the Ti namespace doesnt work on the html either.
Finaly, I created a html file in assets folder on the project and when I get the html code I try to write on it so I could open using 'url' : '/myfile.html'. But when I try to write it gives java.io.IOException: read only
How can I achieve this? Again: I'm trying to get a html content remotely and run locally so I can have access to Ti namespace.
Thanks
I messed up during my testings. Downloading the html and then opening the webview passing the html code to "html" parameter on the webview works just fine. The fireEvent works that way inside the html.
It was not working because it was other problem not related that I fixed.

Chrome DevTools Workspaces: is it possible to change the background color?

I just read this pretty cool article about Chrome DevTools Workspaces:
https://plus.google.com/u/0/+GoogleChromeDevelopers/posts/644qQuBKZeL
I use black themes for all my coding and believe that it's definitely easier on my eyes. Is it possible -- even as a total hack -- to change the bg color of the DevTools UI?
Even changing the bg color of the open file -- and only that -- would be sufficient.
Sure look here for tutorial and themes:
https://plus.google.com/115133653231679625609/posts/UZF34wPJXsL
Basically you have to locate the User Stylesheets directory and override the Custom.css with the given theme:
Mac: ~/Library/Application Support/Google/Chrome/Default/User StyleSheets/Custom.css
PC: C:\Users\YourUsername\AppData\Local\Google\Chrome\User Data\Default\User StyleSheets\Custom.css
Ubuntu (Chromium): ~/.config/chromium/Default/User StyleSheets/Custom.css
As of v.33 of Chrome, the user stylesheets method of injecting stylesheets no longer works.
You can still create your own themes using the devtools extension method.
But if you just want to download other themes, there's a handful of themes available at the Chrome Web Store.

XUL standalone application not starting

I recently took on a project built on XUL (standalone, using xulrunner) - However I can't get it to properly run.
I'm getting this error when I attempt to start it using the command line (xulrunner.exe ../application.ini -jsconsole):
No chrome package registered for chrome://case_scenario_builder/content/case_scenario_builder.xul
The chrome.manifest file looks like this:
content case_scenario_builder file:chrome/case_scenario_builder/content/ contentaccessible=yes
content jslib jar:chrome/jslib.jar!/
skin case_scenario_builder skin file:chrome/case_scenario_builder/skin/
locale case_scenario_builder en-US chrome/case_scenario_builder/locale/en-US/
Any ideas on where I could start debugging?
I figured it out!
In case anyone else runs into this as well:
It was due to the caching system in place by default and the use of .jar containers instead of folders.
The XUL environment had cached both JS and XUL files - and even after disabling those, I had to extract everything that was in the .jar file to the content folder and update the chrome.manifest file.
Thanks for your suggestions on debugging! - they helped the process.
I guess your manifest just isn't getting loaded. To test that I'd introduce an intentional syntax error and check the error console. E.g. if you put
asdfasd
on its own line, you should get a Warning: Ignoring unrecognized chrome manifest directive 'asdfasd'. in the Error console.
(Note to other experts: initially I wanted to suggest dropping 'file:' prefix and avoiding underscores in the package name, but I tested it on a Firefox nightly, and it works fine.)
Your chrome package clearly didn't get registered. From what I can tell, the reason is the bogus file: prefix, you should drop it when specifying relative paths:
content case_scenario_builder chrome/case_scenario_builder/content/ contentaccessible=yes
Btw, I suspect that you copied contentaccessible=yes from somewhere - you should drop it as well unless you know what it does.