Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relative image paths are broken after updating CSS in Android #48

Closed
yossi-shasho opened this issue Jun 15, 2015 · 3 comments
Closed

relative image paths are broken after updating CSS in Android #48

yossi-shasho opened this issue Jun 15, 2015 · 3 comments

Comments

@yossi-shasho
Copy link

in my CSS, i use relative paths to background images e.g. ../img/image.gif.
When the app autoupdates in iOS, the relative paths continue to work just fine.
However in android they're all broken links.

here are my loader settings:

loader = new CordovaAppLoader({
  fs: fs,
  localRoot: "www",
  serverRoot: serverRoot,
  mode: "mirror",
  cacheBuster: true,
  checkTimeout: 10000
});

and manifest:

{
  "files": {
    "app": {
      "version": "d548722725de794f8fd09a0e6857a7a353050aaa",
      "filename": "js/application.js"
    },
    "templates": {
      "version": "e7ded3afbf0b5b5d41c7dba2f052397283c6a8ca",
      "filename": "js/templates.js"
    },
    "style": {
      "version": "2da2c832c55f8c4aeb650d7103c62b77bb097e19",
      "filename": "css/ionic.app.css"
    }
  },
  "load": [
    "js/application.js",
    "js/templates.js",
    "css/ionic.app.css"
  ],
  "version": "33fe7fbd76074e53fced5d26bcbb4eb0f099003a"
}

Any idea? and why would it work differently in android?

@micky2be
Copy link

Sorry I'm a bit late to answer but can you use the cordova file protocol in your css?
It would look like this: cdvfile://localhost/persistent/www/img/image.gif

@ObjectiveTruth
Copy link
Collaborator

In my experience Android doesn't allow relative links in general of the form ../, you have to make it relative to your www folder.

In your case I'd change your image links to img/image.gif instead of ../img/image.gif

@ObjectiveTruth
Copy link
Collaborator

Closing since the issue seems to have been answered adequately, if there's more information to add to the discussion, please reopen 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants