Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Adding files to the script directory disables the extension #14

Open
nickbudi opened this issue Nov 8, 2014 · 13 comments
Open

Adding files to the script directory disables the extension #14

nickbudi opened this issue Nov 8, 2014 · 13 comments

Comments

@nickbudi
Copy link

nickbudi commented Nov 8, 2014

Once I add any file inside the extension's folder, the extension is disabled in chrome with the message: This extension may have been corrupted. Repairing the extension removes any files I've added to /scripts and /styles.

I'm unable to disable the Extension Content Verification flag (chrome://flags/#extension-content-verification) in Chrome 40.0.2209.0 dev.

Any ideas?

@p3lim
Copy link
Owner

p3lim commented Nov 8, 2014

I'll have to take a look at this, I currently don't test on anything except the release versions, so officially I don't support dev channels.

The reason the files got removed is because the extension is reinstalled by chrome, which purges all files first (and is also why I HIGHLY recommend using symlinks)

@p3lim p3lim added the Bug label Nov 8, 2014
@p3lim p3lim self-assigned this Nov 8, 2014
@happyproff
Copy link

@p3lim, I got same problem on release channel (Version 39.0.2171.65 m). I already tried to create links to /scripts and /styles folders and even to each my script and style, but Chrome disabled extension anyway.

@geotheory
Copy link

I've just started finding this too, as annoying Twitter/FB sidebars are back. Both Windows and Mac so seems likely a Chrome update is responsible

@p3lim
Copy link
Owner

p3lim commented Dec 8, 2014

The corruption warning is just that, a warning. If you don't click repair it'll still work just fine (from what I can tell), and the repair button simply reinstalls the extension (thus removing all your files/symlinks).

I don't see a way of resolving this, as the sandboxed environment in chrome is very strict, and short of running a server serving scripts (like the original dotjs), there are not many options left.

@geotheory
Copy link

I'm not so sure. I've got files installed to remove sidebars from Facebook and Twitter and they don't seem to be working, or more accurately they do but very inconsistently (most often they fail). The scripts work in the console: https://gist.github.com/geotheory/d97250e2429bbf12ff85

Any idea why this might be - something to do with delayed loading of the sidebars? It might help if there was a way to add a delay before running the script..

@p3lim
Copy link
Owner

p3lim commented Dec 10, 2014

You could wait for DOM to be loaded, like so:

document.addEventListener('DOMContentLoaded', function(){
    // do stuff here
});

Or with jQuery:

$(document).ready(function(){
    // do stuff here
})

@geotheory
Copy link

Thanks Adrian

It’s working very erratically. I think I’ve established the following:

  •      the scripts are picked up on the first run after the extension is ‘repaired’ – console.log messages come through and the script is actioned (my original line to remove FB sidebar does work in this instance);
    
  •       (nb: the above line fails with the addEventListener bit you suggested);
    
  •      after the first successful run (including after just refreshing the page as well as rebooting Chrome) Chrome does not pick up the scripts again – console.log messages fail to appear. The scripts are still in place however;
    
  •      this happens on my OS X Yosemite (Chrome 39.2171.95 64 bit) and Windows 7 (Chrome 39.0.2171.95 m);
    
  •      not sure this is related but when I define a variable in the script – e.g. “var x = 1;” it is not accessible in the browser console even when the scripts are picked up.  Is this just a variable domain issue?
    

Is this useful?

Robin

From: Adrian L Lange [mailto:[email protected]]
Sent: 10 December 2014 15:29
To: p3lim/dotjs-universal
Cc: Robin Edwards
Subject: Re: [dotjs-universal] Adding files to the script directory disables the extension (#14)

You could wait for DOM to be loaded, like so:

document.addEventListener('DOMContentLoaded', function(){
// do stuff here
});

Or with jQuery:

$(document).ready(function(){
// do stuff here
})


Reply to this email directly or view it on GitHub #14 (comment) . https://github.com/notifications/beacon/ABOSFdr_8BTZiCV7m_gEAu4JGNZ38VRNks5nWF5XgaJpZM4C4rn1.gif

@repton-infinity
Copy link

Getting the same thing. Currently running Chrome 39.0.2171.99 m on Win 8.1.

I tried adding a window.alert() to default.js. Got the popup first time I did anything, but then the extension was marked as corrupt and no more popups. Also Google told me it was disabled if I went to the store page.

@p3lim
Copy link
Owner

p3lim commented Jan 16, 2015

I can't think of anything that I could do to resolve this issue, the updates to Chrome has sadly killed this extension.

Until it is resolved (if ever), I suggest looking at the original extension or something like tampermonkey.

Feel free to submit patches or ideas of how to fix this.

@leesei
Copy link

leesei commented Feb 13, 2015

It's sad that this extension stopped working.

I'm thinking of two one workarounds:

  1. Use Chrome's File System/HTML5 localStorage
    https://developer.chrome.com/apps/app_storage
    We have to add UI to allow user to copy and paste codes to put them into dotjs-universal's sandbox
    It's better to embed an editor (AceEditor/CodeMirror) into the extension
    As a plus, Chrome's File System can be sync'ed across browsers
  2. Use NPAPI
    https://developer.chrome.com/extensions/npapi
    But NPAPI is being phased out and WebStore would not accept extensions using
    the new PepperAPI is also sandboxed so the first way is better

@geotheory
Copy link

RIP dotjs-universal

@judy-zz
Copy link

judy-zz commented Mar 11, 2015

Yeah, I'm really sad about this too. Still looking for other options, but nothing was quite as elegant. I'll go back to trying plain dotjs, but tampermonkey is a bit too heavy-handed for me.

@p3lim
Copy link
Owner

p3lim commented Mar 16, 2015

@leesei I had a plan on making something like you suggested (a full UI with editor), even with support for syncing the scripts with a GitHub repository, but I figured that Tampermonkey would be a better solution in almost every case, and I ended up ditching the idea.

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

No branches or pull requests

7 participants