summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/user_script.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix exclude_matches functionalityaa@chromium.org2011-12-191-0/+15
| | | | | | | | | | | | This should allow the manifest to use the exclude_matches field in content scripts successfully. BUG=107505 TEST=See bug. A simple extension to test the exclude matches functionality, compliments of mihaip@chromium.org, is attached. Review URL: http://codereview.chromium.org/8963010 Patch from Devlin Cronin <RDevlin.Cronin@gmail.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114960 0039d316-1c4b-4281-b951-d872f2087c98
* Define kValidUserScriptSchemes in the .h file so that it can bethakis@chromium.org2011-12-091-2/+6
| | | | | | | | | | | | | evaluated at compile time in extension.cc. Removes 1 static initializer on both linux and mac. BUG=94925 TEST=none Review URL: http://codereview.chromium.org/8892012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113880 0039d316-1c4b-4281-b951-d872f2087c98
* Update URLPatternSet to contain a std::set instead of std::vector.jstritar@chromium.org2011-07-131-3/+4
| | | | | | | | | | | This updates URLPatternSet to contain a std::set instead of a std::vector, making it easier to implement the set operations in ExtensionPermissionSet. BUG=84507 TEST=unit_tests Review URL: http://codereview.chromium.org/7347011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92364 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 92219 - Update URLPatternSet to contain a std::set instead of ↵jstritar@chromium.org2011-07-121-4/+3
| | | | | | | | | | | | | | | | | std::vector. This updates URLPatternSet to contain a std::set instead of a std::vector, making it easier to implement the set operations in ExtensionPermissionSet. BUG=84507 TEST=unit_tests Review URL: http://codereview.chromium.org/7347011 TBR=jstritar@chromium.org Review URL: http://codereview.chromium.org/7346019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92224 0039d316-1c4b-4281-b951-d872f2087c98
* Update URLPatternSet to contain a std::set instead of std::vector.jstritar@chromium.org2011-07-121-3/+4
| | | | | | | | | | | | This updates URLPatternSet to contain a std::set instead of a std::vector, making it easier to implement the set operations in ExtensionPermissionSet. BUG=84507 TEST=unit_tests Review URL: http://codereview.chromium.org/7347011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92219 0039d316-1c4b-4281-b951-d872f2087c98
* Add exclude_matches to content_scripts for negating match patterns.tessamac@chromium.org2011-05-291-0/+4
| | | | | | | | | BUG=13487 TEST=unit_tests and trybots Review URL: http://codereview.chromium.org/7053021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87192 0039d316-1c4b-4281-b951-d872f2087c98
* Rename ExtensionExtent to URLPatternSet and use URLPatternSet instead of ↵morrita@chromium.org2011-05-201-5/+4
| | | | | | | | | | | | | | | | | | std::vector<URLPattern> - Rename ExtensionExtent to URLPatternSet - Refactor common/extensions/user_script.h, common/extensions/user_script.cc, common/extensions/file_browser_handler.h and common/extensions/file_browser_handler.cc so that they use URLPatternSet instead of std::vector<URLPattern> - At many places rename std::vector<URLPattern> to URLPatternList, which is typedefed at common/extensions/url_pattern.h - Rename URLPatternSet::ClearPaths() to URLPatternSet::ClearPatterns() - Rename URLPatternSet::ContainsURL() to URLPatternSet::MatchesUrl() BUG=72955 TEST=ExtensionManifestTest.FileBrowserHandlers, ExtensionUserScriptTest.*, ExtensionURLPatternTest.* Review URL: http://codereview.chromium.org/7038029 Patch from Kentaro Hara <haraken@google.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86060 0039d316-1c4b-4281-b951-d872f2087c98
* Make <all_urls> and file:///* in permissions trigger "Allow file access"mihaip@chromium.org2011-04-011-8/+1
| | | | | | | | | | | | | | | | | | | Move ExtensionWantsFileAccess static functions to Extension::wants_file_access which is set as part of the Extension initialization process. When file:/// access is granted/revoked, instead of storing that in a bit on the UserScript (which didn't help with extension host permissions), we use that to filter down the list of valid schemes for permissions/content script match matterns. That way we don't have to manually exclude file:///* patterns at various call sites (e.g. in UserScriptSlave). BUG=76705 TEST=unit_tests R=aa@chromium.org Review URL: http://codereview.chromium.org/6772022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80213 0039d316-1c4b-4281-b951-d872f2087c98
* Don't try to convert text/html URLs ending in .user.js.aa@chromium.org2011-03-051-3/+3
| | | | | | | | | | | | This doesn't solve the problem with view-source://, that is a separate issue. BUG=35795 TEST=manual, see bug. Review URL: http://codereview.chromium.org/6574033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77020 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: Forward declare and move constructors in chrome/common/extensions/.erg@google.com2010-08-261-16/+9
| | | | | | | | | TEST=none BUG=none Review URL: http://codereview.chromium.org/3207002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57543 0039d316-1c4b-4281-b951-d872f2087c98
* Fix bad license header under chrome/ directory.tfarina@chromium.org2010-07-311-2/+2
| | | | | | | | | BUG=50266 TEST=None Review URL: http://codereview.chromium.org/2847091 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54450 0039d316-1c4b-4281-b951-d872f2087c98
* `#pragma once` for app, base, chrome, gfx, ipc, net, skia, viewsthakis@chromium.org2010-07-261-0/+1
| | | | | | | | | BUG=50273 TEST=everything still builds, build is 10% faster on windows, same speed on mac/linux TBR: erg git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53716 0039d316-1c4b-4281-b951-d872f2087c98
* Add a wildcard scheme and a special 'all_urls' pattern to URLPattern.mpcomplete@chromium.org2010-06-301-0/+3
| | | | | | | | BUG=47179 Review URL: http://codereview.chromium.org/2884008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51295 0039d316-1c4b-4281-b951-d872f2087c98
* Require user opt-in before allowing content script injection on file URLs.mpcomplete@chromium.org2010-06-241-1/+8
| | | | | | | | BUG=47180 Review URL: http://codereview.chromium.org/2809034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50737 0039d316-1c4b-4281-b951-d872f2087c98
* Honor @version field when converting greasemonkey scripts toaa@chromium.org2010-06-221-0/+9
| | | | | | | | | | extensions. BUG=30760 Review URL: http://codereview.chromium.org/2829011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50430 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 43684 - Localize CSS files in content scripts (but don't localize JS ↵cira@google.com2010-04-071-4/+4
| | | | | | | | | | | | | | | | files). Add UserScriptSlave unittest. BUG=39899 TEST=List css file in content_scripts section of the manifest. Refer to an image using url(chromeextension://__MSG_@@extension_id_/image.png); within that css. @@extension_id message should be replaced with actual id of the extension. Review URL: http://codereview.chromium.org/1585013 TBR=cira@chromium.org Review URL: http://codereview.chromium.org/1525014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43784 0039d316-1c4b-4281-b951-d872f2087c98
* Localize CSS files in content scripts (but don't localize JS files).cira@chromium.org2010-04-061-4/+4
| | | | | | | | | | | Add UserScriptSlave unittest. BUG=39899 TEST=List css file in content_scripts section of the manifest. Refer to an image using url(chrome-extension://__MSG_@@extension_id_/image.png); within that css. @@extension_id message should be replaced with actual id of the extension. Review URL: http://codereview.chromium.org/1585013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43684 0039d316-1c4b-4281-b951-d872f2087c98
* Initial work on making extensions work in incognito mode.mpcomplete@chromium.org2010-02-111-1/+7
| | | | | | | | | | | | This merely adds a way to enable content scripts and browser actions in incognito windows. They still don't work properly because none of the APIs work with incognito tabs. The way to enable an extension is to add an "incognito" bit in the user prefs file. My plan is to add UI for this later. BUG=32365 Review URL: http://codereview.chromium.org/567037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38852 0039d316-1c4b-4281-b951-d872f2087c98
* linux: build with -Wextraevan@chromium.org2010-02-051-1/+1
| | | | | | | | | | | | 95% of this is removing "const" from return types, but turning this on found one bug! (A "for" loop that expected its iterator to go negative but which was using an unsigned type.) BUG=34160 Review URL: http://codereview.chromium.org/570012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38266 0039d316-1c4b-4281-b951-d872f2087c98
* Removing unnecessary includes.mad@chromium.org2010-01-281-1/+0
| | | | | | | | | BUG=0 TEST=none Review URL: http://codereview.chromium.org/549186 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37378 0039d316-1c4b-4281-b951-d872f2087c98
* Introduce a new 'all_frames' property to content scripts andaa@chromium.org2009-11-251-1/+10
| | | | | | | | | | | default it to false. This should improve performance in sites that use frames and elimiate confusion, since in most cases developers *don't* expect content scripts to match frames. Review URL: http://codereview.chromium.org/412008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33035 0039d316-1c4b-4281-b951-d872f2087c98
* Add first class support for user scripts.aa@chromium.org2009-11-041-4/+51
| | | | | | | | | | | | Original review: http://codereview.chromium.org/340057 TBR=mpcomplete@chromium.org BUG=22103 TEST=Install a user script (such as from userscripts.org). You should get the extension install UI and the script should show up in the extension management UI. It should also work, though some scripts use Firefox-specific APIs and those won't work in Chromium. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30925 0039d316-1c4b-4281-b951-d872f2087c98
* Re-commit "Add new user script injection point:aa@chromium.org2009-11-031-3/+8
| | | | | | | | | | | document_idle." Original code review: http://codereview.chromium.org/339064 BUG=26126 TBR=rafaelw@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30796 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r30784aa@chromium.org2009-11-031-8/+3
| | | | | | TBR=rafaelw@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30787 0039d316-1c4b-4281-b951-d872f2087c98
* Add new user script injection point "document_idle" and make it the default.aa@chromium.org2009-11-031-3/+8
| | | | | | | | | | | | | Semantically, document-idle means "when the DOM is ready and layout has been idle for awhile", or more loosely, "as soon as we get around to it". Right now this uses a simple heuristic. It injects scripts 200ms after DOMContentLoaded, or immediately after onload, whichever happens first. BUG=26126 TEST=Manual. Extensions with content scripts should work. Review URL: http://codereview.chromium.org/339064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30784 0039d316-1c4b-4281-b951-d872f2087c98
* Minimize dependency of user scripts.mad@chromium.org2009-10-201-10/+12
| | | | | | | | | | | And made some minor lint fixes and code refactoring on the way, based on CR comments of previous attempt. BUG=none TEST=Make sure that the extension resources can still be properly localized and that they also load correctly when they are not localized. Review URL: http://codereview.chromium.org/267051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29512 0039d316-1c4b-4281-b951-d872f2087c98
* Loads local resources from current locale subtree if available, if not it ↵cira@chromium.org2009-10-071-7/+10
| | | | | | | | | | | | | | | | | falls back to extension subtree. We look for ext_root/foo/bar.js under ext_root/_locales/fr/foo/bar.js if current locale is fr. If there is no fr specific resource we load ext_root/foo/bar.js instead. Lots of small refactoring to replace FilePath with ExtensionResource. BUG=12131 TEST=See unittest for sample tree. Review URL: http://codereview.chromium.org/256022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28333 0039d316-1c4b-4281-b951-d872f2087c98
* Move StringPiece into the base namespace. It is collidingtony@chromium.org2009-09-101-4/+4
| | | | | | | | | | with the StringPiece class in icu4.2, which is a problem when trying to use the system version of icu. Review URL: http://codereview.chromium.org/193072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25920 0039d316-1c4b-4281-b951-d872f2087c98
* Update of the extension install UI:aa@chromium.org2009-08-271-2/+4
| | | | | | | | | | | | | | | | | - Give the user more information about which hosts an extension can access. - Remove the red severe warning because it doesn't play well with themes and because it adds nothing when the other text is more specific. - Make the image a bit smaller. Also integrate this new idea with the silent/not-silent update flow. BUG=12129,12140,19582 Review URL: http://codereview.chromium.org/173463 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24599 0039d316-1c4b-4281-b951-d872f2087c98
* Small cleanup of constness.mad@google.com2009-06-181-2/+2
| | | | | | | | | | | | | Added const to methods not changing the state, except for the lazy setting of an escaped version of a path which is now mutable. Also made some lint fixes. BUG=none TEST=none Review URL: http://codereview.chromium.org/132024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18733 0039d316-1c4b-4281-b951-d872f2087c98
* Try one more time to check in http://codereview.chromium.org/60112aa@chromium.org2009-04-081-0/+9
| | | | | | | | | | | | Added this test to the list of skipped purify tests as it is experience the same issue as ExtensionView test. I also found an unrelated memory leak and created a patch separately: http://codereview.chromium.org/63073 Review URL: http://codereview.chromium.org/63075 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13369 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Implement chromium.self in content scripts..."aa@chromium.org2009-04-071-9/+0
| | | | | | | | | | This reverts commit 61ab30f52667e739602ab2af4fd8f2d8a0a2a2f0. Still seeing memory errors. Review URL: http://codereview.chromium.org/63056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13243 0039d316-1c4b-4281-b951-d872f2087c98
* Implement chromium.self in content scripts, so that developers don'taa@chromium.org2009-04-071-0/+9
| | | | | | | | | | | | | | | | | | | | | have to know and copy/paste their extension ID. This required moving the code that defaults the extension ID earlier in the load process. Also fixed some bugs: * fixed a bug that was causing all user scripts to get executed in the same context. * made the greasemonkey api only available in 'standalone' user scripts. * re-added the anonymous function wrapper that is supposed to wrap content scripts. Also added unit tests for the fixed bugs. Review URL: http://codereview.chromium.org/60112 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13238 0039d316-1c4b-4281-b951-d872f2087c98
* Remove unneeded uses of base/pickle.h. Add some explicit #includes.thestig@chromium.org2009-04-031-1/+2
| | | | | | Review URL: http://codereview.chromium.org/60095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13093 0039d316-1c4b-4281-b951-d872f2087c98
* Review URL: http://codereview.chromium.org/42288georged@chromium.org2009-03-181-16/+70
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12016 0039d316-1c4b-4281-b951-d872f2087c98
* Add early-injection capability to user scripts.aa@chromium.org2009-02-141-1/+20
| | | | | | Review URL: http://codereview.chromium.org/19624 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9822 0039d316-1c4b-4281-b951-d872f2087c98
* Integrate URLPattern with Extension user scripts.aa@chromium.org2009-02-051-0/+74
Also refactored the UserScript class in UserScriptSlave and the UserScriptInfo structure in UserScriptMaster into a common location. Review URL: http://codereview.chromium.org/21070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9270 0039d316-1c4b-4281-b951-d872f2087c98